Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWriteExceedsBufCap = errors.New("exceeds buffer capacty")
ErrWriteExceedsBufCap is returned when write exceeds buffer capacity.
Functions ¶
This section is empty.
Types ¶
type LimitedBuf ¶
type LimitedBuf struct {
// contains filtered or unexported fields
}
LimitedBuf implements io.Writer interface.
func NewBuffer ¶
func NewBuffer(buf []byte, max int) *LimitedBuf
NewBuffer creates a new buffer which implements io.Writer interface. The bytes slice passed should be allocated with Len: 0 Cap: default You cannot pass nil and expect the buffer to created. The max argument specifies the max number of bytes to allow in the buffer.
func (*LimitedBuf) Bytes ¶
func (b *LimitedBuf) Bytes() []byte
Bytes is wrapper which calls bytes.Bytes()
Click to show internal directories.
Click to hide internal directories.