Object datum = reader.read(null,
DecoderFactory.get().binaryDecoder(input, null));
DatumWriter<Object> writer = new GenericDatumWriter<Object>(schema);
JsonGenerator g =
new JsonFactory().createJsonGenerator(out, JsonEncoding.UTF8);
g.useDefaultPrettyPrinter();
writer.write(datum, EncoderFactory.get().jsonEncoder(schema, g));
g.flush();
out.println();
out.flush();
} finally {