Skip to content

Commit

Permalink
proper pipe io
Browse files Browse the repository at this point in the history
  • Loading branch information
dyu committed May 31, 2020
1 parent 7662005 commit ee67bb3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4385,7 +4385,7 @@ public void writeTo(Output output, int number, AbstractCollection<T> value, bool
@Override
public void transfer(Pipe pipe, Input input, Output output, int number, boolean repeated) throws IOException
{
writeTo(output, number, readFrom(input), repeated);
output.writeObject(number, pipe, schema.pipeSchema, repeated);
}

@Override
Expand All @@ -4399,7 +4399,7 @@ public Class<?> typeClass()
public static final class CollectionSchemaForBaz extends CollectionSchema<Baz>
{

static final Schema<Baz> SCHEMA = RuntimeSchema.getSchema(Baz.class);
static final HasSchema<Baz> HS = RuntimeSchema.getSchemaWrapper(Baz.class);

public CollectionSchemaForBaz()
{
Expand All @@ -4409,20 +4409,20 @@ public CollectionSchemaForBaz()
@Override
protected void addValueFrom(Input input, Collection<Baz> collection) throws IOException
{
collection.add(input.mergeObject(null, SCHEMA));
collection.add(input.mergeObject(null, HS.getSchema()));
}

@Override
protected void writeValueTo(Output output, int fieldNumber, Baz value, boolean repeated) throws IOException
{
output.writeObject(fieldNumber, value, SCHEMA, repeated);
output.writeObject(fieldNumber, value, HS.getSchema(), repeated);
}

@Override
protected void transferValue(Pipe pipe, Input input, Output output, int number, boolean repeated)
throws IOException
{
throw new UnsupportedOperationException();
output.writeObject(number, pipe, HS.getPipeSchema(), repeated);
}

}
Expand Down

0 comments on commit ee67bb3

Please sign in to comment.