Documentation
¶
Overview ¶
Package buffr provides a buffered reader.
Index ¶
- Variables
- type Reader
- func (r *Reader) Buffered() int
- func (r *Reader) Discard(n int) (int, error)
- func (r *Reader) Peek(p []byte) (int, error)
- func (r *Reader) Read(p []byte) (int, error)
- func (r *Reader) ReadByte() (byte, error)
- func (r *Reader) ReadSlice(delim byte) ([]byte, error)
- func (r *Reader) Reset(rd io.Reader)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNegativeCount = errors.New("buffr: negative count")
ErrNegativeCount is returned when a negative number of bytes is requested.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements buffering for an io.Reader object. Reader does not read from the underlying reader unless its buffer is empty, reducing the risk of cross-packet reading.
func (*Reader) Buffered ¶
Buffered returns the number of bytes that can be read from the current buffer.
func (*Reader) Discard ¶
Discard skips the next n bytes, returning the number of bytes discarded. If Discard skips fewer than n bytes, it also returns an error.
func (*Reader) Peek ¶
Peek reads data in p without advancing the reader. It returns the number of bytes read into p.
Click to show internal directories.
Click to hide internal directories.