private JsonGenerator createJsonGenerator(ByteArrayOutputStream baos) throws IOException {
JsonGenerator generator = m_factory.createJsonGenerator(new OutputStreamWriter(baos,
Charset.forName("UTF-8").newEncoder()));
DefaultPrettyPrinter p = new DefaultPrettyPrinter();
p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
generator.setPrettyPrinter(p);
return generator;
}