@Override protected void transfer(Pipe pipe, Input input, Output output) throws IOException { for (int number = input.readFieldNumber(wrappedSchema); number != 0; number = input .readFieldNumber(wrappedSchema)) { final Field<T> field = fieldsMap.getFieldByNumber(number); if (field == null) input.handleUnknownField(number, wrappedSchema); else field.transfer(pipe, input, output, field.repeated); } } }
@Override public String readString() throws IOException { return input.readString(); }
public void mergeFrom(Input input, A message) throws IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: message.value = input.readInt32(); break; default: input.handleUnknownField(number, this); } } }
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) return; case 1: message.someInt = input.readInt32(); break; case 2: message.someString = input.readString(); break; case 3: message.someBaz = input.mergeObject(message.someBaz, Baz.getSchema()); break; case 4: message.someEnum = Status.valueOf(input.readEnum()); break; case 5: message.someBytes = input.readBytes(); break; case 6: message.someBoolean = input.readBool(); break; case 7: message.someFloat = input.readFloat(); break; case 8: message.someDouble = input.readDouble(); break; case 9: message.someLong = input.readInt64();
@Override public Object readFrom(Input input, Object owner) throws IOException { if (ID_ARRAY_LEN != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); final int len = input.readInt32(); return primitive ? readPrimitiveFrom(input, owner, len) : readBoxedFrom(input, owner, len); }
@Override public void mergeFrom(Input input, Baz message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.id = input.readInt32(); break; case 2: message.name = input.readString(); break; case 3: message.timestamp = input.readInt64(); break; default: input.handleUnknownField(number, this); } } }
@Override public void mergeFrom(Input input, PojoWithBiggerByteArray message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.id = input.readInt32(); break; case 2: message.b = input.readByteArray(); break; case 3: message.ts = input.readInt64(); break; default: input.handleUnknownField(number, this); } } }
@Override public void mergeFrom(Input input, ClubFounder message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.name = input.readString(); break; case 2: message.club = input.mergeObject(message.club, Club.getSchema()); break; default: input.handleUnknownField(number, this); } } }
public void mergeFrom(Input input, SampleClass message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: if (message.testString == null) message.testString = new ArrayList<String>(); message.testString.add(input.readString()); break; default: input.handleUnknownField(number, this); } } }
@Override public Object readFrom(Input input, Object owner) throws IOException { if (ID_ARRAY_LEN != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); final int len = input.readInt32(); ByteString[] array = new ByteString[len]; if (input instanceof GraphInput) { // update the actual reference. ((GraphInput) input).updateLast(array, owner); } for (int i = 0; i < len;) { switch (input.readFieldNumber(this)) { case ID_ARRAY_DATA: array[i++] = input.readBytes(); break; case ID_ARRAY_NULLCOUNT: i += input.readUInt32(); break; default: throw new ProtostuffException("Corrupt input."); } } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }
@Override public void mergeFrom(Input input, FPNumbers message) throws IOException { for (int number = input.readFieldNumber(this); ; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.floatValue = input.readFloat(); break; case 2: message.doubleValue = input.readDouble(); break; default: input.handleUnknownField(number, this); } } }
@Override public void mergeFrom(Input input, WrapperPojo message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.requiresName = input.mergeObject(message.requiresName, RequiresName.SCHEMA); break; default: input.handleUnknownField(number, this); } } }
@Override public void mergeFrom(Input input, Bat message) throws IOException { for (int number = input.readFieldNumber(this);; number = input .readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.id = input.readUInt32(); break; default: input.handleUnknownField(number, this); } } }
protected Object readBoxedFrom(Input input, Object owner, int len) throws IOException { final Boolean[] array = new Boolean[len]; if (input instanceof GraphInput) { // update the actual reference. ((GraphInput) input).updateLast(array, owner); } for (int i = 0; i < len;) { switch (input.readFieldNumber(this)) { case ID_ARRAY_DATA: array[i++] = input.readBool(); break; case ID_ARRAY_NULLCOUNT: i += input.readUInt32(); break; default: throw new ProtostuffException("Corrupt input."); } } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }
protected Object readBoxedFrom(Input input, Object owner, int len) throws IOException { final Double[] array = new Double[len]; if (input instanceof GraphInput) { // update the actual reference. ((GraphInput) input).updateLast(array, owner); } for (int i = 0; i < len;) { switch (input.readFieldNumber(this)) { case ID_ARRAY_DATA: array[i++] = input.readDouble(); break; case ID_ARRAY_NULLCOUNT: i += input.readUInt32(); break; default: throw new ProtostuffException("Corrupt input."); } } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }
static void transferObject(Pipe.Schema<Object> pipeSchema, Pipe pipe, Input input, Output output, IdStrategy strategy) throws IOException { transferObject(pipeSchema, pipe, input, output, strategy, input.readFieldNumber(pipeSchema.wrappedSchema)); }
protected Object readBoxedFrom(Input input, Object owner, int len) throws IOException { final Long[] array = new Long[len]; if (input instanceof GraphInput) { // update the actual reference. ((GraphInput) input).updateLast(array, owner); } for (int i = 0; i < len;) { switch (input.readFieldNumber(this)) { case ID_ARRAY_DATA: array[i++] = input.readInt64(); break; case ID_ARRAY_NULLCOUNT: i += input.readUInt32(); break; default: throw new ProtostuffException("Corrupt input."); } } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }
@Override protected Object kFrom(Input input, MapWrapper<Object, Object> wrapper) throws IOException { return input.mergeObject(null, schemaK.getSchema()); }
protected Object readPrimitiveFrom(Input input, Object owner, int len) throws IOException { long[] array = new long[len]; if (input instanceof GraphInput) { // update the actual reference. ((GraphInput) input).updateLast(array, owner); } for (int i = 0; i < len; i++) { if (ID_ARRAY_DATA != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); array[i] = input.readInt64(); } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }
protected Object readPrimitiveFrom(Input input, Object owner, int len) throws IOException { boolean[] array = new boolean[len]; if (input instanceof GraphInput) { // update the actual reference. ((GraphInput) input).updateLast(array, owner); } for (int i = 0; i < len; i++) { if (ID_ARRAY_DATA != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); array[i] = input.readBool(); } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }