readUint16BE function

int readUint16BE(
  1. List<int> data, [
  2. int offset = 0
])

Reads a 16-bit unsigned integer value in big-endian byte order from a list.

Implementation

int readUint16BE(List<int> data, [int offset = 0]) {
  if (offset < 0 || offset + 2 > data.length) {
    throw RangeError('Index out of bounds');
  }
  return ((data[offset] & mask8) << 8) | (data[offset + 1] & mask8);
}