Documentation ¶
Overview ¶
Package gather implements data structures storing binary data organized in a series of byte slices of fixed size that only gathered together by the user.
Index ¶
- func DumpStats(ctx context.Context)
- type Bytes
- func (b *Bytes) AppendSectionTo(w io.Writer, offset, size int) error
- func (b Bytes) AppendToSlice(output []byte) []byte
- func (b Bytes) Length() int
- func (b Bytes) ReadAt(p []byte, off int64) (n int, err error)
- func (b Bytes) Reader() io.Reader
- func (b Bytes) ToByteSlice() []byte
- func (b Bytes) WriteTo(w io.Writer) (int64, error)
- type WriteBuffer
- func (b *WriteBuffer) Append(data []byte)
- func (b *WriteBuffer) AppendSectionTo(w io.Writer, offset, size int) error
- func (b *WriteBuffer) Bytes() Bytes
- func (b *WriteBuffer) Close()
- func (b *WriteBuffer) Length() int
- func (b *WriteBuffer) MakeContiguous(length int) []byte
- func (b *WriteBuffer) Reset()
- func (b *WriteBuffer) ToByteSlice() []byte
- func (b *WriteBuffer) Write(data []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bytes ¶
type Bytes struct { Slices [][]byte // contains filtered or unexported fields }
Bytes represents a sequence of bytes split into slices.
func (*Bytes) AppendSectionTo ¶
AppendSectionTo writes the section of the buffer to the provided writer.
func (Bytes) AppendToSlice ¶ added in v0.9.0
AppendToSlice appends the contents to the provided slice.
func (Bytes) ToByteSlice ¶ added in v0.9.0
ToByteSlice returns contents as a newly-allocated byte slice.
type WriteBuffer ¶
type WriteBuffer struct {
// contains filtered or unexported fields
}
WriteBuffer is a write buffer for content of unknown size that manages data in a series of byte slices of uniform size.
func (*WriteBuffer) Append ¶
func (b *WriteBuffer) Append(data []byte)
Append appends the specified slice of bytes to the buffer.
func (*WriteBuffer) AppendSectionTo ¶ added in v0.8.0
func (b *WriteBuffer) AppendSectionTo(w io.Writer, offset, size int) error
AppendSectionTo appends the section of the buffer to the provided slice and returns it.
func (*WriteBuffer) Bytes ¶ added in v0.8.0
func (b *WriteBuffer) Bytes() Bytes
Bytes returns inner gather.Bytes.
func (*WriteBuffer) Close ¶
func (b *WriteBuffer) Close()
Close releases all memory allocated by this buffer.
func (*WriteBuffer) Length ¶ added in v0.8.0
func (b *WriteBuffer) Length() int
Length returns the combined length of all slices.
func (*WriteBuffer) MakeContiguous ¶ added in v0.9.0
func (b *WriteBuffer) MakeContiguous(length int) []byte
MakeContiguous ensures the write buffer consists of exactly one contiguous single slice of the provided length and returns the slice.
func (*WriteBuffer) ToByteSlice ¶ added in v0.9.0
func (b *WriteBuffer) ToByteSlice() []byte
ToByteSlice appends all bytes to the provided slice and returns it.