decodeSelf method

  1. @override
void decodeSelf(
  1. RawReader reader
)
override

Decodes state from the bytes.

Implementation

@override
void decodeSelf(RawReader reader) {
  // 16-bit source port
  sourcePort = reader.readUint16();

  // 16-bit destination port
  destinationPort = reader.readUint16();

  // 16-bit payload length
  final payloadLength = reader.readUint16();

  // 16-bit checksum (ignored)
  reader.readUint16();

  // Payload
  payload = RawData.decode(reader, payloadLength);
}