decode method

  1. @override
void decode(
  1. Uint8List data,
  2. int protocolVersion,
  3. MessageEncoding encoding
)
override

Decode message from bytes

Implementation

@override
void decode(Uint8List data, int protocolVersion, MessageEncoding encoding) {
  if (data.length != 8) {
    throw WireException('Ping message must be exactly 8 bytes');
  }

  final buffer = ByteData.sublistView(data);
  nonce = buffer.getUint64(0, Endian.little);
}