packToBytes method

Uint8List packToBytes(
  1. IsoMsg message, {
  2. int maxMessageSize = 9999,
})

Recalculates the bitmap and packs into a fresh buffer, the same sequence the Java encoder performs before writing to the channel.

Implementation

Uint8List packToBytes(IsoMsg message, {int maxMessageSize = 9999}) {
  message.recalcBitMap();
  final IsoBuffer buffer = IsoBuffer.allocate(maxMessageSize);
  pack(message, buffer);
  return buffer.toBytes();
}