Documentation
¶
Index ¶
- Variables
- type FixedBuffer
- func (b *FixedBuffer) Cap() int
- func (b *FixedBuffer) Free()
- func (b *FixedBuffer) HasRemaining() bool
- func (b *FixedBuffer) Len() int
- func (b *FixedBuffer) Read(p []byte) (n int, err error)
- func (b *FixedBuffer) ReadFrom(r io.Reader) (int64, error)
- func (b *FixedBuffer) Write(p []byte) (n int, err error)
- func (b *FixedBuffer) WriteTo(w io.Writer) (n int64, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFull = errors.New("buffer full")
Functions ¶
This section is empty.
Types ¶
type FixedBuffer ¶
type FixedBuffer struct {
// contains filtered or unexported fields
}
func NewFixedBuffer ¶
func NewFixedBuffer(n int) *FixedBuffer
func (*FixedBuffer) Cap ¶
func (b *FixedBuffer) Cap() int
func (*FixedBuffer) Free ¶
func (b *FixedBuffer) Free()
func (*FixedBuffer) HasRemaining ¶
func (b *FixedBuffer) HasRemaining() bool
func (*FixedBuffer) Len ¶
func (b *FixedBuffer) Len() int
func (*FixedBuffer) Read ¶
func (b *FixedBuffer) Read(p []byte) (n int, err error)
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. err is nil or io.EOF(buf all read).
func (*FixedBuffer) ReadFrom ¶
func (b *FixedBuffer) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads data from r until io.EOF or b is full, and appends it to the buffer. The return value n is the number of bytes read. Any error except io.EOF encountered during the read is also returned nil err means Reader io.EOF ErrFull means buf full and Reader not io.EOF.
Click to show internal directories.
Click to hide internal directories.