@Override
            protected void end(Pipe.Schema<?> pipeSchema, Input input,
                    boolean cleanupOnly) throws IOException
            {
                if (cleanupOnly)
                {
                    parser.close();
                    return;
                }

                assert input == jsonInput;
                final JsonToken token = parser.getCurrentToken();

                parser.close();

                if (token != JsonToken.END_OBJECT)
                {
                    throw new JsonInputException("Expected token: } but was " +
                            token + " on message " +
                            pipeSchema.wrappedSchema.messageFullName());
                }
            }
Creates a json pipe from a {@link JsonParser}.
protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java