unpack16 function
Unpacks a 16 bit integer from a byte buffer. The inp
parameter can be an Uint8List or a
ByteData if you will run it several times against the same buffer and want faster execution.
Implementation
int unpack16(dynamic inp, int offset, Endian endian) {
if (inp is! ByteData) {
inp = ByteData.view(
inp.buffer as ByteBuffer, inp.offsetInBytes as int, inp.length as int?);
}
return inp.getUint16(offset, endian);
}