VarInt class

Constructors

VarInt.fromBuffer(List<int> buf, int offset)
Constructs a new VarInt with the value parsed from the specified offset of the given buffer.
VarInt.fromInt(int value)
Constructs a new VarInt with the given unsigned long value.

Properties

hashCode int
The hash code for this object.
no setterinherited
originallyEncodedSize int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value int
@deprecated use {{@link #intValue()} or {{@link #longValue()}}}
getter/setter pair

Methods

encode() List<int>
Encodes the value into its minimal representation.
getOriginalSizeInBytes() int
Returns the original number of bytes used to encode the value if it was deserialized from a byte array, or the minimum encoded size if it was not.
getSizeInBytes() int
Returns the minimum encoded size of the value.
intValue() int
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromStream(ByteDataReader stream) VarInt
sizeOf(int value) int
Returns the minimum encoded size of the given unsigned long value.