MySQLPacket.decodeColumnDefPacket constructor

MySQLPacket.decodeColumnDefPacket(
  1. Uint8List buffer
)

Implementation

factory MySQLPacket.decodeColumnDefPacket(Uint8List buffer) {
  int offset = 0;

  final header = MySQLPacket.decodePacketHeader(buffer);
  offset += 4;
  final payloadLength = header.item1;
  final sequenceNumber = header.item2;

  final payload = MySQLColumnDefinitionPacket.decode(
    Uint8List.sublistView(buffer, offset),
  );

  return MySQLPacket(
    sequenceID: sequenceNumber,
    payloadLength: payloadLength,
    payload: payload,
  );
}