read method

void read(
  1. TProtocol iprot
)
override

Reads the TObject from the given input protocol.

Implementation

read(TProtocol iprot) {
  TField field;
  iprot.readStructBegin();
  while (true) {
    field = iprot.readFieldBegin();
    if (field.type == TType.STOP) {
      break;
    }
    switch (field.id) {
      case SPACE_ID:
        if (field.type == TType.I32) {
          this.space_id = iprot.readI32();
          this.__isset_space_id = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case PARTS:
        if (field.type == TType.MAP) {
          {
            TMap _map254 = iprot.readMapBegin();
            this.parts = <int, List<Int8List>>{};
            for (int _i255 = 0; _i255 < _map254.length; ++_i255) {
              int _key256;
              List<Int8List> _val257;
              _key256 = iprot.readI32();
              {
                TList _list258 = iprot.readListBegin();
                _val257 = <Int8List>[];
                for (int _i259 = 0; _i259 < _list258.length; ++_i259) {
                  Int8List _elem260;
                  _elem260 = iprot.readBinary();
                  _val257.add(_elem260);
                }
                iprot.readListEnd();
              }
              this.parts?[_key256] = _val257;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case RETURN_PARTLY:
        if (field.type == TType.BOOL) {
          this.return_partly = iprot.readBool();
          this.__isset_return_partly = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      default:
        TProtocolUtil.skip(iprot, field.type);
        break;
    }
    iprot.readFieldEnd();
  }
  iprot.readStructEnd();

  // check for required fields of primitive type, which can't be checked in the validate method
  validate();
}