public static byte[] toJsonBytes(Inspector inspector, boolean compact) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        new JsonFormat(compact ? 0 : 2).encode(baos, inspector);
        return baos.toByteArray();
    }
Extra utilities/operations on slime trees.

@author Ulf Lilleengen
vespajlib/src/main/java/com/yahoo/slime/SlimeUtils.java