You could insert something like the following between each call to write():
encoder.flush(); ostream.write((byte)'\n'); or you could pass a JsonGenerator to EncoderFactory#jsonEncoder a MinimalPrettyPrinter whose rootValueSeparator is set to "\n". http://jackson.codehaus.org/1.8.4/javadoc/org/codehaus/jackson/util/MinimalPrettyPrinter.html Perhaps we do this by default for JSON output? If you feel this is the case, please file an issue in Jira. https://issues.apache.org/jira/browse/AVRO Thanks, Doug On 10/04/2011 10:57 AM, Yang wrote: > if I do > > writer = new SpecificDatumWriter<SpecificRecord>(schema); > encoder = EncoderFactory.get().jsonEncoder(schema, ostream); > > writer.write(my_specific_record, encoder); > writer.write(my_specific_record.encoder); > > > it adds a space " " between the 2 records, I guess for separation. > is it possible to remove that? or changing that to "\n" is much better > > > Thanks > Yang
