Esempio n. 1
0
  public void mergeFrom(Input input, Object /* Foo */ messageObj) throws IOException {
    Foo message = (Foo) messageObj;
    for (int number = input.readFieldNumber(this); ; number = input.readFieldNumber(this)) {
      switch (number) {
        case 0:
          return;
        case 1:
          if (message.someInt == null) message.someInt = new Vector();
          message.someInt.addElement(new Integer(input.readInt32()));
          break;
        case 2:
          if (message.someString == null) message.someString = new Vector();
          message.someString.addElement(input.readString());
          break;

        case 3:
          if (message.someBar == null) message.someBar = new Vector();
          message.someBar.addElement(input.mergeObject(null, Bar.getSchema()));
          break;

        case 4:
          if (message.someEnum == null) message.someEnum = new Vector();
          message.someEnum.addElement(new Integer(input.readEnum()));
          break;

        case 5:
          if (message.someBytes == null) message.someBytes = new Vector();
          message.someBytes.addElement(input.readBytes());
          break;

        case 6:
          if (message.someBoolean == null) message.someBoolean = new Vector();
          message.someBoolean.addElement(input.readBool() ? Boolean.TRUE : Boolean.FALSE);
          break;
        case 7:
          if (message.someFloat == null) message.someFloat = new Vector();
          message.someFloat.addElement(new Float(input.readFloat()));
          break;
        case 8:
          if (message.someDouble == null) message.someDouble = new Vector();
          message.someDouble.addElement(new Double(input.readDouble()));
          break;
        case 9:
          if (message.someLong == null) message.someLong = new Vector();
          message.someLong.addElement(new Long(input.readInt64()));
          break;
        default:
          input.handleUnknownField(number, this);
      }
    }
  }
Esempio n. 2
0
        protected void transfer(Pipe pipe, Input input, Output output) throws IOException {
          for (int number = input.readFieldNumber(wrappedSchema);
              ;
              number = input.readFieldNumber(wrappedSchema)) {
            switch (number) {
              case 0:
                return;
              case 1:
                output.writeInt32(number, input.readInt32(), true);
                break;
              case 2:
                input.transferByteRangeTo(output, true, number, true);
                break;

              case 3:
                output.writeObject(number, pipe, Bar.getPipeSchema(), true);
                break;

              case 4:
                output.writeEnum(number, input.readEnum(), true);
                break;

              case 5:
                input.transferByteRangeTo(output, false, number, true);
                break;
              case 6:
                output.writeBool(number, input.readBool(), true);
                break;
              case 7:
                output.writeFloat(number, input.readFloat(), true);
                break;
              case 8:
                output.writeDouble(number, input.readDouble(), true);
                break;
              case 9:
                output.writeInt64(number, input.readInt64(), true);
                break;
              default:
                input.handleUnknownField(number, wrappedSchema);
            }
          }
        }