return createJsonStreamTarget(new OutputStreamWriter(output), pretty);
}
@Override
public JsonStreamTarget createJsonStreamTarget(Writer writer, boolean pretty) {
JsonWriter jsonWriter = new JsonWriter(new FilterWriter(writer) {
@Override
public void close() throws IOException {
flush(); // avoid closing underlying stream
}
});