getInt method

int getInt(
  1. int offset,
  2. int length, [
  3. Endian endian = Endian.little
])

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 0offsetoffset+lengththis.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);
}