docs: private ByteArrayOutputStream toByteStream(Object item, boolean pretty) throws IOException {
      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
      JsonGenerator generator = createJsonGenerator(byteStream, Charsets.UTF_8);
      if (pretty) {
        generator.enablePrettyPrint();
      }
      generator.serialize(item);
      generator.flush();
      return byteStream;
    }