Documentation ¶
Overview ¶
Package binary extends Go standard library package encoding/binary to support arbitrary, variable-sized values. The Go standard library package encoding/binary provides encoding/decoding of fixed-size Go values or slices of same. This package extends support to arbitrary, variable-sized values by prefixing these values with their varint-encoded size, recursively. It expects the encoded type and decoded type to match exactly and makes no attempt to reconcile or check for any differences.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( LittleEndian = binary.LittleEndian BigEndian = binary.BigEndian DefaultEndian = LittleEndian )
Functions ¶
Types ¶
type Decoder ¶
func NewDecoder ¶
type Encoder ¶
func NewEncoder ¶
func NewStrictEncoder ¶
NewStrictEncoder creates an encoder similar to NewEncoder, however if this encoder attempts to encode a struct and the struct has no encodable fields an error is returned whereas the encoder returned from NewEncoder will simply not write anything to `w`.