From ee67bb3aa6f1e0207224bb8c19d3e0a4a32f0538 Mon Sep 17 00:00:00 2001 From: dyu Date: Sun, 31 May 2020 19:57:42 +0800 Subject: [PATCH] proper pipe io --- .../runtime/AbstractRuntimeObjectSchemaTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/protostuff-runtime/src/test/java/io/protostuff/runtime/AbstractRuntimeObjectSchemaTest.java b/protostuff-runtime/src/test/java/io/protostuff/runtime/AbstractRuntimeObjectSchemaTest.java index 4e2a3a508..da04504ac 100644 --- a/protostuff-runtime/src/test/java/io/protostuff/runtime/AbstractRuntimeObjectSchemaTest.java +++ b/protostuff-runtime/src/test/java/io/protostuff/runtime/AbstractRuntimeObjectSchemaTest.java @@ -4385,7 +4385,7 @@ public void writeTo(Output output, int number, AbstractCollection 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 @@ -4399,7 +4399,7 @@ public Class typeClass() public static final class CollectionSchemaForBaz extends CollectionSchema { - static final Schema SCHEMA = RuntimeSchema.getSchema(Baz.class); + static final HasSchema HS = RuntimeSchema.getSchemaWrapper(Baz.class); public CollectionSchemaForBaz() { @@ -4409,20 +4409,20 @@ public CollectionSchemaForBaz() @Override protected void addValueFrom(Input input, Collection 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); } }