public static byte[] toJsonBytes(Slime slime) {
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            new JsonFormat(true).encode(baos, slime);
            return baos.toByteArray();
        }
        catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
Returns the given slime data as UTF-8-encoded JSON
vespajlib/src/main/java/com/yahoo/slime/JsonFormat.java