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); } } }
static void transferObject(Pipe.Schema<Object> pipeSchema, Pipe pipe, Input input, Output output, IdStrategy strategy) throws IOException { if (ID_ENUM != input.readFieldNumber(pipeSchema.wrappedSchema)) throw new ProtostuffException("Corrupt input."); strategy.transferEnumId(input, output, ID_ENUM); if (ID_ENUM_VALUE != input.readFieldNumber(pipeSchema.wrappedSchema)) throw new ProtostuffException("Corrupt input."); EnumIO.transfer(pipe, input, output, 1, false, strategy); if (0 != input.readFieldNumber(pipeSchema.wrappedSchema)) throw new ProtostuffException("Corrupt input."); }
protected Object readPrimitiveFrom(Input input, Object owner, int len) throws IOException { int[] array = new int[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.readInt32(); } if (0 != input.readFieldNumber(this)) throw new ProtostuffException("Corrupt input."); return array; }
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); } } }
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) if (message.someInt32 == null) message.someInt32 = new ArrayList<Integer>(); message.someInt32.add(input.readInt32()); break; case 2: if (message.someFixed64 == null) message.someFixed64 = new ArrayList<Long>(); message.someFixed64.add(input.readFixed64()); break; default: input.handleUnknownField(number, this);
@Override public void mergeFrom(Input input, RequiresName 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.description = input.readString(); 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); } } }
public void mergeFrom(Input input, FragmentPriority message) throws IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: message.workloadClass = WorkloadClass.valueOf(input.readEnum()); break; default: input.handleUnknownField(number, this); } } }
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) if (entry != input.mergeObject(entry, entrySchema)) throw new ProtostuffException("The map was incorrectly serialized.");
@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(); String[] array = new String[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.readString(); 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 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 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 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(); Object[] array = (Object[])Array.newInstance(hs.getSchema().typeClass(), 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.mergeObject(null, hs.getSchema()); 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, Object message) throws IOException { input.readFieldNumber(null); String typeUrl = input.readString(); input.readFieldNumber(null); byte[] bytes = input.readByteArray(); input.readFieldNumber(null); AnyEntry anyEntry = (AnyEntry) message; anyEntry.setTypeUrl(typeUrl); anyEntry.setValue(bytes); }
@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); } } }
@Override public void mergeFrom(Input input, HasHasBar 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.hasBar = readHasBar(input); 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(); return primitive ? readPrimitiveFrom(input, owner, len) : readBoxedFrom(input, owner, len); }
public void mergeFrom(Input input, GetCatalogsReq message) throws IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: message.catalogNameFilter = input.mergeObject(message.catalogNameFilter, LikeFilter.getSchema()); break; default: input.handleUnknownField(number, this); } } }
public void mergeFrom(Input input, FilterByType message) throws IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: message.type = DataType.valueOf(input.readEnum()) ; break; default: input.handleUnknownField(number, this); } } }
Object m = input.mergeObject(wrapper, strategy.POLYMORPHIC_MAP_SCHEMA); if (!graph || !((GraphInput) input).isCurrentMessageReference()) m = wrapper.value; if (1 != input.readFieldNumber(schema)) throw new ProtostuffException("Corrupt input."); Object keyType = input.mergeObject(wrapper, strategy.CLASS_SCHEMA); if (!graph || !((GraphInput) input).isCurrentMessageReference()) keyType = wrapper.value; if (2 != input.readFieldNumber(schema)) throw new ProtostuffException("Corrupt input."); Object valueType = input.mergeObject(wrapper, strategy.CLASS_SCHEMA); if (!graph || !((GraphInput) input).isCurrentMessageReference()) valueType = wrapper.value;