Documentation ¶
Overview ¶
Package varint provides the varint type V. V knows how to write and read its binary encoded representation from a reader or writer
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxVLen16 = 3 MaxVLen32 = 5 MaxVLen64 = 10 )
View Source
var ErrOverflow = errors.New("varint: varint overflows a 64-bit integer")
Functions ¶
This section is empty.
Types ¶
type V ¶
type V uint64
V is a varint that knows how to read and write its binary form. its in-memory representation is always uint64.
After a call to ReadBinary, V can be converted to an unsigned integer. Likewise, setting V and calling WriteBinary writes V's varint value to the writer.
This implementation does not handle signed values or zig-zag encoding.
func (*V) ReadBinary ¶
ReadBinary read a varint from the underlying reader. It does not read beyond the varint.
Click to show internal directories.
Click to hide internal directories.