static String toJsonString(Inspector obj, boolean enableRawAsBase64) {
            JsonRender.StringEncoder encoder =enableRawAsBase64
                    ? new WithBase64()
                    : new JsonRender.StringEncoder(new StringBuilder(), true);
            encoder.encode(obj);
            return encoder.target().toString();
        }
Only for testing. Never to be used in any other context.
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java