OkPacket.fromBuffer constructor

OkPacket.fromBuffer(
  1. ReadBuffer buffer
)

Implementation

factory OkPacket.fromBuffer(ReadBuffer buffer) {
  buffer.seek(1);
  int? affectedRows = buffer.readLengthCodedBinary();
  int? insertId = buffer.readLengthCodedBinary();
  int serverStatus = buffer.uint16;
  String message = buffer.stringToEnd;

  return OkPacket(affectedRows: affectedRows, insertId: insertId, serverStatus: serverStatus, message: message);
}