encode method

  1. @override
Uint8List encode()
override

Implementation

@override
Uint8List encode() {
  if (connectWithDB) {
    capabilityFlags = capabilityFlags | mysqlCapFlagClientConnectWithDB;
  }

  final buffer = ByteDataWriter(endian: Endian.little);

  buffer.writeUint32(capabilityFlags);
  buffer.writeUint32(maxPacketSize);
  buffer.writeUint8(characterSet);
  buffer.write(List.filled(23, 0));

  return buffer.toBytes();
}