use of com.fasterxml.jackson.core.json.UTF8JsonGenerator in project neo4j by neo4j.
the class StreamingJsonFormat method createJsonFactory.
private static JsonFactory createJsonFactory() {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.disable(FLUSH_AFTER_WRITE_VALUE);
JsonFactory factory = new JsonFactory(objectMapper) {
@Override
protected JsonGenerator _createUTF8Generator(OutputStream out, IOContext ctxt) {
final int bufferSize = 1024 * 8;
UTF8JsonGenerator gen = new UTF8JsonGenerator(ctxt, _generatorFeatures, _objectCodec, out, DEFAULT_QUOTE_CHAR, new byte[bufferSize], 0, true);
if (_characterEscapes != null) {
gen.setCharacterEscapes(_characterEscapes);
}
return gen;
}
};
factory.disable(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM);
return factory;
}
Aggregations