readValueLength method

int readValueLength(
  1. IsoBuffer buffer
)

Implementation

int readValueLength(IsoBuffer buffer) {
  final int first = buffer.get();
  final int count = first & 0x7F;
  if (first & 0x80 == 0 || count == 0) return count;
  final Uint8List bytes = buffer.getBytes(count);
  int length = 0;
  for (final int byte in bytes) {
    length = length << 8 | byte & 0xFF;
  }
  return length;
}