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 COORDLIST:
        if (field.type == TType.LIST) {
          {
            TList _list26 = iprot.readListBegin();
            this.coordList = <Coordinate>[];
            for (int _i27 = 0; _i27 < _list26.length; ++_i27) {
              Coordinate _elem28;
              _elem28 = new Coordinate();
              _elem28.read(iprot);
              this.coordList?.add(_elem28);
            }
            iprot.readListEnd();
          }
        } 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();
}