Documentation
¶
Overview ¶
Package bytes provides utilities for operating bytes.
Index ¶
- func Copy(a []byte) []byte
- func ResizeExact(b []byte, n int) []byte
- func ResizeOver(b []byte, n int) []byte
- type Buffer
- func (b *Buffer) Bytes() []byte
- func (*Buffer) Close() error
- func (b *Buffer) Path() string
- func (b *Buffer) Read(offset int64, buffer []byte) (int, error)
- func (b *Buffer) Reset()
- func (b *Buffer) SequentialRead() fs.SeqReader
- func (b *Buffer) SequentialWrite() fs.SeqWriter
- func (b *Buffer) Write(bb []byte) (int, error)
- func (b *Buffer) WriteByte(b2 byte) error
- type BufferPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResizeExact ¶
ResizeExact resizes the byte slice to the exact size.
func ResizeOver ¶
ResizeOver resizes the byte slice to the nearest power of 2.
Types ¶
type Buffer ¶
type Buffer struct {
Buf []byte
}
Buffer is a in-memory buffer.
func (*Buffer) SequentialRead ¶
SequentialRead implements fs.Reader.
func (*Buffer) SequentialWrite ¶
SequentialWrite implements fs.Writer.
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool is a pool of Buffer.
func NewBufferPool ¶ added in v0.7.0
func NewBufferPool(name string) *BufferPool
NewBufferPool creates a new BufferPool.
Click to show internal directories.
Click to hide internal directories.