toBytes method

Uint8List toBytes(
  1. dynamic zlib,
  2. Random random,
  3. int blockSize
)

Implementation

Uint8List toBytes(dynamic zlib, Random random, int blockSize) {
  Uint8List payload = Uint8List(serializedSize + 1);
  SerializableOutput output = SerializableOutput(payload);
  output.addUint8(id);
  serialize(output);
  if (!output.done) {
    throw FormatException('${output.offset}/${output.buffer.length}');
  }
  return toPacket(
      zlib != null ? zlib.convert(payload) : payload, random, blockSize);
}