getInt3 method

int getInt3(
  1. int startOffset
)

LĂȘ um inteiro de 3 bytes (little-endian) a partir de startOffset.

Esse formato (3 bytes) ocorre em algumas partes do protocolo que usam "int<3>" para valores como comprimentos ou contagens menores que 16M.

Implementation

int getInt3(int startOffset) {
  final bd = ByteData(4);
  bd.setUint8(0, getUint8(startOffset));
  bd.setUint8(1, getUint8(startOffset + 1));
  bd.setUint8(2, getUint8(startOffset + 2));
  bd.setUint8(3, 0);
  return bd.getUint32(0, Endian.little);
}