Field.fromBuffer constructor

Field.fromBuffer(
  1. ReadBuffer buffer
)

Implementation

factory Field.fromBuffer(ReadBuffer buffer) {
  String? catalog = buffer.readLengthCodedString();
  String? db = buffer.readLengthCodedString();
  String? table = buffer.readLengthCodedString();
  String? orgTable = buffer.readLengthCodedString();
  String? name = buffer.readLengthCodedString();
  String? orgName = buffer.readLengthCodedString();
  buffer.skip(1);
  int characterSet = buffer.uint16;
  int length = buffer.uint32;
  int type = buffer.byte;
  int flags = buffer.uint16;
  int decimals = buffer.byte;
  buffer.skip(2);
  int? defaultValue;
  if (buffer.canReadMore) defaultValue = buffer.readLengthCodedBinary();

  return Field(name,
      catalog: catalog,
      db: db,
      table: table,
      orgTable: orgTable,
      orgName: orgName,
      characterSet: characterSet,
      length: length,
      type: type,
      flags: flags,
      decimals: decimals,
      defaultValue: defaultValue);
}