private static void writeUtf8(long codepoint, BufferedOutput buf, long mask) {
        if ((codepoint & mask) == 0) {
            buf.put((byte) ((mask << 1) | codepoint));
        } else {
            writeUtf8(codepoint >> 6, buf, mask >> (2 - ((mask >> 6) & 0x1)));
            buf.put((byte) (0x80 | (codepoint & 0x3f)));
        }

    }
Decode bytes as a UTF-8 JSON into Slime, or throw {@link JsonParseException} on invalid JSON.
vespajlib/src/main/java/com/yahoo/slime/JsonDecoder.java