bufio

package
v1.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package bufio contains tools for reusing bufio.Reader and bufio.Writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireReader

func AcquireReader(r io.Reader) *bufio.Reader

AcquireWriter returns bufio.Writer with default buffer size.

func AcquireReaderSize

func AcquireReaderSize(r io.Reader, size int) *bufio.Reader

AcquireReaderSize returns bufio.Reader with given buffer size. Note that size is rounded up to nearest highest power of two.

func AcquireWriter

func AcquireWriter(w io.Writer) *bufio.Writer

AcquireWriter returns bufio.Writer with default buffer size.

func AcquireWriterSize

func AcquireWriterSize(w io.Writer, size int) *bufio.Writer

AcquireWriterSize returns bufio.Writer with given buffer size. Note that size is rounded up to nearest highest power of two.

func ReleaseReader

func ReleaseReader(r *bufio.Reader, size int)

ReleaseReaderSize takes bufio.Reader for future reuse. Note that size should be the same as used to acquire reader. If you have acquired reader from AcquireReader function, set size to 0. If size == 0 then default buffer size is used.

func ReleaseWriter

func ReleaseWriter(w *bufio.Writer, size int)

ReleaseWriterSize takses bufio.Writer for future reuse. Note that size should be the same as used to acquire writer. If you have acquired writer from AcquireWriter function, set size to 0. If size == 0 then default buffer size is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL