Exemplo n.º 1
0
 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
   getSerializedSize();
   if (((bitField0_ & 0x00000001) == 0x00000001)) {
     output.writeEnum(1, errCode_.getNumber());
   }
   if (((bitField0_ & 0x00000002) == 0x00000002)) {
     output.writeBytes(2, getErrMsgBytes());
   }
   if (((bitField0_ & 0x00000004) == 0x00000004)) {
     output.writeBytes(3, getResultBytes());
   }
   getUnknownFields().writeTo(output);
 }
Exemplo n.º 2
0
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, errCode_.getNumber());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getErrMsgBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, getResultBytes());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }
Exemplo n.º 3
0
 private HelloResponse(
     com.google.protobuf.CodedInputStream input,
     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     throws com.google.protobuf.InvalidProtocolBufferException {
   initFields();
   int mutable_bitField0_ = 0;
   com.google.protobuf.UnknownFieldSet.Builder unknownFields =
       com.google.protobuf.UnknownFieldSet.newBuilder();
   try {
     boolean done = false;
     while (!done) {
       int tag = input.readTag();
       switch (tag) {
         case 0:
           done = true;
           break;
         default:
           {
             if (!parseUnknownField(
                 input, unknownFields,
                 extensionRegistry, tag)) {
               done = true;
             }
             break;
           }
         case 8:
           {
             int rawValue = input.readEnum();
             cn.klzhong.samples.proto.hello.Hello.HelloResponse.ErrorCode value =
                 cn.klzhong.samples.proto.hello.Hello.HelloResponse.ErrorCode.valueOf(rawValue);
             if (value == null) {
               unknownFields.mergeVarintField(1, rawValue);
             } else {
               bitField0_ |= 0x00000001;
               errCode_ = value;
             }
             break;
           }
         case 18:
           {
             com.google.protobuf.ByteString bs = input.readBytes();
             bitField0_ |= 0x00000002;
             errMsg_ = bs;
             break;
           }
         case 26:
           {
             com.google.protobuf.ByteString bs = input.readBytes();
             bitField0_ |= 0x00000004;
             result_ = bs;
             break;
           }
       }
     }
   } catch (com.google.protobuf.InvalidProtocolBufferException e) {
     throw e.setUnfinishedMessage(this);
   } catch (java.io.IOException e) {
     throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage())
         .setUnfinishedMessage(this);
   } finally {
     this.unknownFields = unknownFields.build();
     makeExtensionsImmutable();
   }
 }