extractMessageBlock method

int extractMessageBlock(
  1. int start,
  2. int expectedBlockLength
)

Implementation

int extractMessageBlock(int start, int expectedBlockLength) {
  int current = start;
  _input.offset = current;
  final blockLength = _input.readUint32();
  assert(
    blockLength + 4 == expectedBlockLength,
    'Message BlockLength is not correct',
  );
  current = current + 4;
  _input.offset = current;
  final algoId = _input.readUint32();
  _algoIds.add(algoId);
  current = current + 4;
  _input.offset = current;
  final messageLength = _input.readUint32();
  current = current + 4;
  _input.offset = current;
  final messageBytes = _input.readBytes(messageLength);
  _messages.add(messageBytes.toUint8List());
  return current + messageLength;
}