getInt method
Reads a region of the buffer as a signed 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([83, 112, 62]);
final int value = buffer.getInt(0, 3);
print(value); // 4091987
Implementation
int getInt(final int offset, final int length,
[final Endian endian = Endian.little]) {
return getUint(offset, length, endian).toSigned(length * _bitLength);
}