private static JsonGenerator createPrivateGenerator(OutputStream out) {
        try {
            return jsonFactory.createGenerator(out);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
Create a Document writer which will write to the input JSON generator.
JsonWriter will not close the generator and only flush it explicitly
after having written a full Document instance. In other words, JsonWriter
will <i>not</i> take ownership of the generator.

@param generator the output JSON generator
@param tensorOptions tensor formatting options (short/long, direct/wrapped, hexdump or not)
document/src/main/java/com/yahoo/document/json/JsonWriter.java