Documentation ¶
Index ¶
- Variables
- func GetLittleEndianUint32(b []byte, offset int) uint32
- func GetLittleEndianUint64(b []byte, offset int) uint64
- func PutLittleEndianUint32(b []byte, offset int, v uint32)
- func PutLittleEndianUint64(b []byte, offset int, v uint64)
- type Buffer
- func (b *Buffer) Close() error
- func (b *Buffer) DontNeed(c Cursor) error
- func (b *Buffer) Insert(data []byte) error
- func (b *Buffer) Len() uint64
- func (b *Buffer) Read(data []byte, c Cursor) (n int, next Cursor, err error)
- func (b *Buffer) ReadFirst(data []byte) (n int, next Cursor, err error)
- func (b *Buffer) Remaining(from Cursor) uint64
- func (b *Buffer) Unmap()
- type Cursor
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetLittleEndianUint32 ¶
func GetLittleEndianUint64 ¶
func PutLittleEndianUint32 ¶
func PutLittleEndianUint64 ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) Insert ¶
Insert adds data into b. Caller is free to recycle the underlying array of the slice.
func (*Buffer) Len ¶
Len returns the total data bytes stored in the buffer. This does not include the space used for framing.
func (*Buffer) Read ¶
Read copies record that c points to into data. It returns number of bytes copied, a cursor to the next record, and error if there was any.
If c points to a record that has been ejected from b the call is analogous to b.ReadFirst.
If c points to a record that has not yet arrived an ErrNotArrived error is returned.
If data does not have enough room for record an ErrPartialData error is returned.
func (*Buffer) ReadFirst ¶
ReadFirst reads the first (oldest) record in b. It's return values are analogous to Read.