MySQLPacketColumnCount.decode constructor
MySQLPacketColumnCount.decode(
- Uint8List buffer
Decodifica um buffer Uint8List recebido do servidor e cria uma instância de MySQLPacketColumnCount.
O buffer contém o número de colunas codificado como um inteiro com codificação length-encoded.
A função getVariableEncInt é utilizada para extrair esse valor a partir do início do buffer.
Implementation
factory MySQLPacketColumnCount.decode(Uint8List buffer) {
final columnCount = buffer.getVariableEncIntAt(0);
if (columnCount.$1 < BigInt.one) {
throw MySQLProtocolException(
'Invalid column count in MySQLPacketColumnCount: ${columnCount.$1}',
);
}
return MySQLPacketColumnCount(
columnCount: columnCount.$1,
);
}