getBigInt method
Reads a region of the buffer as a signed big integer
.
Items are read from the range [offset : offset+length]
.
The range must satisy the relations 0
≤ offset
≤ offset+length
≤ this.length
.
final Buffer buffer = Buffer.fromList([255, 255, 31, 236, 95, 13, 82, 66, 20, 2]);
final BigInt value = buffer.getBigInt(0, buffer.length);
print(value); // 9818446744073709551615
Implementation
BigInt getBigInt(final int offset, final int length,
[final Endian endian = Endian.little]) {
return getBigUint(offset, length, endian).toSigned(length * _bitLength);
}