Documentation ¶
Index ¶
- func Borrow() []byte
- func PutUint16(w io.Writer, byteOrder binary.ByteOrder, val uint16) error
- func PutUint32(w io.Writer, byteOrder binary.ByteOrder, val uint32) error
- func PutUint64(w io.Writer, byteOrder binary.ByteOrder, val uint64) error
- func PutUint8(w io.Writer, val uint8) error
- func Return(buf []byte)
- func Uint16(r io.Reader, byteOrder binary.ByteOrder) (uint16, error)
- func Uint32(r io.Reader, byteOrder binary.ByteOrder) (uint32, error)
- func Uint64(r io.Reader, byteOrder binary.ByteOrder) (uint64, error)
- func Uint8(r io.Reader) (uint8, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Borrow ¶
func Borrow() []byte
Borrow returns a byte slice from the free list with a length of 8. A new buffer is allocated if there are not any available on the free list.
func PutUint16 ¶
PutUint16 serializes the provided uint16 using the given byte order into a buffer from the free list and writes the resulting two bytes to the given writer.
func PutUint32 ¶
PutUint32 serializes the provided uint32 using the given byte order into a buffer from the free list and writes the resulting four bytes to the given writer.
func PutUint64 ¶
PutUint64 serializes the provided uint64 using the given byte order into a buffer from the free list and writes the resulting eight bytes to the given writer.
func PutUint8 ¶
PutUint8 copies the provided uint8 into a buffer from the free list and writes the resulting byte to the given writer.
func Return ¶
func Return(buf []byte)
Return puts the provided byte slice back on the free list. The buffer MUST have been obtained via the Borrow function and therefore have a cap of 8.
func Uint16 ¶
Uint16 reads two bytes from the provided reader using a buffer from the free list, converts it to a number using the provided byte order, and returns the resulting uint16.
func Uint32 ¶
Uint32 reads four bytes from the provided reader using a buffer from the free list, converts it to a number using the provided byte order, and returns the resulting uint32.
Types ¶
This section is empty.