public static void writeWrapperByteArrayAsJson(JsonGenerator generator, Byte[] array)
      throws IOException {
    generator.writeStartArray();
    for (Byte obj : array) {
      generator.writeNumber(obj);
    }
    generator.writeEndArray();
  }
The JsonWriter class is an utility to write various java types as a JSON string.
<p>

@since GemFire 8.0
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JsonWriter.java