Documentation ¶
Overview ¶
Package bufio provides a buffered reader and writer that propagate calls to Flush and Close.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
Reader is a modified version of the Reader from the standard library bufio package that wraps an io.ReadCloser and closes its underlying closer when the Close method is called.
func NewReader ¶
func NewReader(r io.ReadCloser) *Reader
NewReader returns a new NewReader whose buffer has the default size.
func NewReaderSize ¶
func NewReaderSize(r io.ReadCloser, size int) *Reader
NewReaderSize returns a new Reader whose buffer has at least the specified size. If the argument io.Reader is already a Reader with large enough size, it returns the underlying Reader.
func NewReaderSizeClose ¶
func NewReaderSizeClose(r io.ReadCloser, size int, close bool) *Reader
NewReaderSizeClose returns a new Reader whose buffer has at least the specified size. If the argument io.Reader is already a Reader with large enough size, it returns the underlying Reader.
func (*Reader) Reset ¶
func (b *Reader) Reset(r io.ReadCloser)
type Scanner ¶
Scanner is a modified version of the Scanner from the standard library bufio package that wraps an io.ReadCloser and closes its underlying closer when the Close method is called.
func NewScanner ¶
func NewScanner(r io.ReadCloser) *Scanner
NewScanner returns a new Scanner to read from r. The split function defaults to ScanLines.
type Writer ¶
func NewWriterClose ¶
NewWriterClose returns a new Writer whose buffer has the default size. If close is false, then does not close the underlying writer.
func NewWriterSize ¶
NewWriterSize returns a new Writer whose buffer has at least the specified size. If the argument io.Writer is already a Writer with large enough size, it returns the underlying Writer.
func NewWriterSizeClose ¶
NewWriterSizeClose returns a new Writer whose buffer has at least the specified size. If the argument io.Writer is already a Writer with large enough size, it returns the underlying Writer.