Documentation
¶
Index ¶
- type Buffer
- func (cb *Buffer) Len() int
- func (cb *Buffer) MustClose()
- func (cb *Buffer) MustReadAt(p []byte, off int64)
- func (cb *Buffer) MustWrite(p []byte)
- func (cb *Buffer) NewReader() filestream.ReadCloser
- func (cb *Buffer) Path() string
- func (cb *Buffer) Reset()
- func (cb *Buffer) SizeBytes() int
- func (cb *Buffer) Write(p []byte) (int, error)
- func (cb *Buffer) WriteTo(w io.Writer) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer provides in-memory buffer optimized for storing big bytes volumes.
It stores the data in chunks of fixed size. This reduces memory fragmentation and memory waste comparing to the contiguous slices of bytes.
func (*Buffer) MustReadAt ¶
MustReadAt reads len(p) bytes from cb at the offset off.
func (*Buffer) NewReader ¶
func (cb *Buffer) NewReader() filestream.ReadCloser
NewReader returns a reader for reading the data stored in cb.
func (*Buffer) Reset ¶
func (cb *Buffer) Reset()
Reset resets the cb, so it can be reused for writing new data into it.
Reset frees up memory chunks allocated for cb, so they could be reused by other Buffer instances.
Click to show internal directories.
Click to hide internal directories.