Documentation ¶
Overview ¶
Package util contains low lever helper function for parsing byte buffers
Index ¶
- Constants
- func ReadAll(r io.Reader, capacity int64) (b []byte, err error)
- func ReadByte(r io.Reader) (byte, error)
- func ReadFloat64(r io.Reader) (float64, error)
- func ReadUint16(r io.Reader) (uint16, error)
- func ReadUint32(r io.Reader) (uint32, error)
- func ReadUint64(r io.Reader) (uint64, error)
- type ReadBuf
Constants ¶
View Source
const ( LenByte = 1 LenUint16 = 2 LenUint32 = 4 LenUint64 = 8 LenFloat64 = 8 )
convenience consts describing the length of certain C types in bytes
Variables ¶
This section is empty.
Functions ¶
func ReadAll ¶
ReadAll is taken verbatim from ioutil in the standard library and we use it to read the binary count data into a preallocated buffer of the correct size. Using a correctly preallocated buffer is critical especially for large binary data files in the multi GB range to avoid excessive memory use due to uncollected memory
func ReadFloat64 ¶
ReadFloat64 reads a float64 from an io.Reader
func ReadUint16 ¶
ReadUint16 reads an uint16 from an io.Reader
func ReadUint32 ¶
ReadUint32 reads an uint32 from an io.Reader
Types ¶
Click to show internal directories.
Click to hide internal directories.