Read() public method

public Read ( TProtocol iprot ) : void
iprot Thrift.Protocol.TProtocol
return void
示例#1
0
 public void Read(TProtocol iprot)
 {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
         field = iprot.ReadFieldBegin();
         if (field.Type == TType.Stop)
         {
             break;
         }
         switch (field.ID)
         {
             case 1:
                 if (field.Type == TType.Struct)
                 {
                     Tbl = new Table();
                     Tbl.Read(iprot);
                 }
                 else
                 {
                     TProtocolUtil.Skip(iprot, field.Type);
                 }
                 break;
             default:
                 TProtocolUtil.Skip(iprot, field.Type);
                 break;
         }
         iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
示例#2
0
 public void Read(TProtocol iprot)
 {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
         field = iprot.ReadFieldBegin();
         if (field.Type == TType.Stop)
         {
             break;
         }
         switch (field.ID)
         {
             case 0:
                 if (field.Type == TType.Struct)
                 {
                     Success = new Table();
                     Success.Read(iprot);
                 }
                 else
                 {
                     TProtocolUtil.Skip(iprot, field.Type);
                 }
                 break;
             case 1:
                 if (field.Type == TType.Struct)
                 {
                     O1 = new MetaException();
                     O1.Read(iprot);
                 }
                 else
                 {
                     TProtocolUtil.Skip(iprot, field.Type);
                 }
                 break;
             case 2:
                 if (field.Type == TType.Struct)
                 {
                     O2 = new NoSuchObjectException();
                     O2.Read(iprot);
                 }
                 else
                 {
                     TProtocolUtil.Skip(iprot, field.Type);
                 }
                 break;
             default:
                 TProtocolUtil.Skip(iprot, field.Type);
                 break;
         }
         iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }