Sorry about the whitespace changes, is there a formatter for Eclipse?
Corrected my initial patch so that BinaryFragmentToJsonTool now pretty prints by default and I have added a --no-pretty option. I also added the --schema-file option to both BinaryFragmentToJsonTool and JsonToBinaryFragmentTool.
JSON Pretty Printing
I added a method EncoderFactory.jsonEncoder(Schema schema, OutputStream out, boolean pretty) and changed JsonEncoder to create an extended DefaultPrettyPrinter that uses a line.separator as the root value separator rather than a space that is hard coded in DefaultPrettyPrinter. This could be used to provide a pretty print option for the tojson tool
JsonToBinaryFragmentTool Catches EOFException
This appears to be the only way to detect the end of the file, it is only thrown if the JSON parser has no more tokens and the stack depth is at the root level. A truncated JSON object throws a JsonParseException. The fromjson tool uses this method too.
Please review this patch.