bufio

package
v2.0.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer implements buffering for an io.WriteCloser object.

Writer provides access to a buffered writer that can be closed. Closing the writer will result in all remaining data being flushed from the buffer before the underlying WriteCloser is closed.

func NewWriter

func NewWriter(w io.WriteCloser) *Writer

NewWriter initialises a new Writer with the default buffer size.

func NewWriterSize

func NewWriterSize(w io.WriteCloser, sz int) *Writer

NewWriterSize initialises a new Writer with the provided buffer size.

func (*Writer) Close

func (w *Writer) Close() error

Close closes the Writer, flushing any remaining data from the buffer.

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write writes the contents of p into the buffer. It returns the number of bytes written. If fewer than len(p) bytes are written, and error is returned explaining why.

Jump to

Keyboard shortcuts

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