Package binaryex implements functions supplement to binary/encoding package.
It is designed for ease of use before speed.
It supports binary marshaling of all go types, excluding chans, funcs and
unsafePointers.
Ints and Uints of any size are encoded as VarInts, floats and complex
numbers using binary encoding in LittleEndian order, and strings, arrays,
slices and maps are prefixed by a number (varint) specifying number of
their elements then written as a LittleEndian byte stream.
Write functions take values or pointers to values. If a Pointer value was
passed to a Write function it is dereferenced up to the value itself then
written.
Read functions take pointers to output values only as they have to be
mutable. If the dereferenced output value is a pointer itself, a new
value is allocated for it.
If a pointer with a a nil value was Written, when Read, the pointer will
have its' value allocated (not nil) and value set to zero of that type.
All functions can panic if they encounter invalid parameters as most checks
are ommited for performance reasons.
If a value supports encoding.Binary(un)Marshaler it is preferred. Watch out
for infinite loops if calling Read, ReadReflect, Write or WriteReflect from
a BinaryMarshaler or BinaryUnmarshaler implementor.
If an unsupported value is encountered functions will error.
Ecosystem
proxy.golang.org
Latest Release
v0.1.1
over 5 years ago
Versions
2