encode method

  1. @override
Uint8List encode()
override

Codifica o comando INIT DB em um Uint8List para envio ao servidor.

A estrutura codificada é:

  1. Um byte de comando (2).
  2. A string do schema em UTF-8.

Implementation

@override
Uint8List encode() {
  final buffer = ByteDataWriter(endian: Endian.little);
  // Escreve o comando INIT DB (2)
  buffer.writeUint8(2);
  // Escreve o nome do schema (UTF-8)
  buffer.write(utf8.encode(schemaName));
  return buffer.toBytes();
}