Documentation
¶
Overview ¶
Package bnry provides simple functions for encoding and decoding values as binary.
Supported data types ¶
The types that can be encoded and decoded are int*, uint* (excluding int and uint), float*, bool, string and slices of these types. Read and UnmarshalBinary expect pointers to these types, while Write and MarshalBinary expect non-pointers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalBinary ¶
MarshalBinary writes the given values to a byte slice. Values should be of any of the supported types. Panics if a value is of an unsupported type.
func Read ¶
func Read(r io.ByteReader, vals ...any) error
Read reads and decodes binary data into the given values. Values should be pointers to any of the supported types. Panics if a value is of an unsupported type.
func UnmarshalBinary ¶
UnmarshalBinary decodes binary data into the given values. Values should be pointers to any of the supported types. Panics if a value is of an unsupported type.