Documentation
¶
Overview ¶
This file has been generated from 'bin.yml', do not edit
Index ¶
- Variables
- func CastStruct(to interface{}, b []byte) error
- func UnsafeCastStruct(to interface{}, b []byte)
- type I16
- type I16be
- type I16le
- type I32
- type I32be
- type I32le
- type I64
- type I64be
- type I64le
- type I8
- type I8be
- type I8le
- type U16
- type U16be
- type U16le
- type U32
- type U32be
- type U32le
- type U64
- type U64be
- type U64le
- type U8
- type U8be
- type U8le
Constants ¶
This section is empty.
Variables ¶
var NativeEndian = binary.LittleEndian
Architecture native encoding
Functions ¶
func CastStruct ¶
CastStruct casts a byte slice its contents into an arbitrary go-structure. The structure passed must be a pointer to a pointer of a structed to be casted too. An error is returned if the input type is invalid or the buffer is not big enough to hold the structure. If the input buffers length is 0, `to` will be set to nil.
func UnsafeCastStruct ¶
func UnsafeCastStruct(to interface{}, b []byte)
UnsafeCastStruct casts a byte slice its contents into an arbitrary go-structure. The structure passed must be a pointer to a pointer of a struct to be casted too.
If the input buffers length is 0, `to` will be set to nil.
The operation is unsafe, as it does not validate the input value to be a pointer of a pointer, plus no length check is executed.
Types ¶
type I16be ¶
type I16be [2]byte
I16be wraps a byte array into a big endian encoded 16bit signed integer.
type I16le ¶
type I16le [2]byte
I16le wraps a byte array into a little endian encoded 16bit signed integer.
type I32be ¶
type I32be [4]byte
I32be wraps a byte array into a big endian encoded 32bit signed integer.
type I32le ¶
type I32le [4]byte
I32le wraps a byte array into a little endian encoded 32bit signed integer.
type I64be ¶
type I64be [8]byte
I64be wraps a byte array into a big endian encoded 64bit signed integer.
type I64le ¶
type I64le [8]byte
I64le wraps a byte array into a little endian encoded 64bit signed integer.
type I8be ¶
type I8be [1]byte
I8be wraps a byte array into a big endian encoded 8bit signed integer.
type I8le ¶
type I8le [1]byte
I8le wraps a byte array into a little endian encoded 8bit signed integer.
type U16be ¶
type U16be [2]byte
U16be wraps a byte array into a big endian encoded 16bit unsigned integer.
type U16le ¶
type U16le [2]byte
U16le wraps a byte array into a little endian encoded 16bit unsigned integer.
type U32be ¶
type U32be [4]byte
U32be wraps a byte array into a big endian encoded 32bit unsigned integer.
type U32le ¶
type U32le [4]byte
U32le wraps a byte array into a little endian encoded 32bit unsigned integer.
type U64be ¶
type U64be [8]byte
U64be wraps a byte array into a big endian encoded 64bit unsigned integer.
type U64le ¶
type U64le [8]byte
U64le wraps a byte array into a little endian encoded 64bit unsigned integer.
type U8be ¶
type U8be [1]byte
U8be wraps a byte array into a big endian encoded 8bit unsigned integer.