Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrVarIntTooBig = errors.New("mcproto: var int is too big")
)
Functions ¶
func DecodeReaderVarInt ¶
DecodeReaderVarInt takes an io.Reader as a parameter and returns in order:
- the result varint
- the number of bytes read
- an eventual error
NOTE: It returns the number of bytes read even in occurance of an error
func DecodeReaderVarLong ¶ added in v0.1.1
DecodeReaderVarInt takes an io.Reader as a parameter and returns in order:
- the result varlong
- the number of bytes read
- an eventual error
NOTE: It returns the number of bytes read even in occurance of an error
func EncodeVarInt ¶
EncoeVarInt is an implementation of the varint encoding as specified on wiki.vg
It takes an int32 as an input, and returns the encoded varint in the form of a byte slice, and also returns n which is the number of bytes the varint takes
func EncodeVarLong ¶ added in v0.1.1
EncoeVarLong is an implementation of the varlong encoding as specified on wiki.vg
It takes an int64 as an input, and returns the encoded varint in the form of a byte slice, and also returns n which is the number of bytes the varint takes
Types ¶
This section is empty.