Documentation ¶
Overview ¶
Package bufio is a replacement of the standard golang package bufio.
Index ¶
- func OriginalReader(reader io.Reader) *bufio.Reader
- func OriginalReaderSize(reader io.Reader, size int) *bufio.Reader
- type BufferedReader
- type BufferedWriter
- func (v *BufferedWriter) Cached() bool
- func (v *BufferedWriter) Flush() error
- func (v *BufferedWriter) FlushWithoutLock() error
- func (v *BufferedWriter) ReadFrom(reader io.Reader) (int64, error)
- func (v *BufferedWriter) Release()
- func (v *BufferedWriter) SetCached(cached bool)
- func (v *BufferedWriter) Write(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OriginalReader ¶
OriginalReader invokes bufio.NewReader() from Golang standard library.
Types ¶
type BufferedReader ¶
BufferedReader is a reader with internal cache.
func NewReader ¶
func NewReader(rawReader io.Reader) *BufferedReader
NewReader creates a new BufferedReader based on an io.Reader.
func (*BufferedReader) Cached ¶
func (v *BufferedReader) Cached() bool
Cached returns true if the internal cache is effective.
func (*BufferedReader) Read ¶
func (v *BufferedReader) Read(b []byte) (int, error)
Read implements io.Reader.Read().
func (*BufferedReader) Release ¶
func (v *BufferedReader) Release()
Release implements Releasable.Release().
func (*BufferedReader) SetCached ¶
func (v *BufferedReader) SetCached(cached bool)
SetCached is to enable or disable internal cache. If cache is disabled, Read() and Write() calls will be delegated to the underlying io.Reader directly.
type BufferedWriter ¶
func NewWriter ¶
func NewWriter(rawWriter io.Writer) *BufferedWriter
func (*BufferedWriter) Cached ¶
func (v *BufferedWriter) Cached() bool
func (*BufferedWriter) Flush ¶
func (v *BufferedWriter) Flush() error
func (*BufferedWriter) FlushWithoutLock ¶
func (v *BufferedWriter) FlushWithoutLock() error
func (*BufferedWriter) ReadFrom ¶
func (v *BufferedWriter) ReadFrom(reader io.Reader) (int64, error)
func (*BufferedWriter) Release ¶
func (v *BufferedWriter) Release()
func (*BufferedWriter) SetCached ¶
func (v *BufferedWriter) SetCached(cached bool)
Click to show internal directories.
Click to hide internal directories.