public Slime decode(Slime slime, ByteBuffer buf) {
        in = new BufferedInput(buf.array(), buf.arrayOffset()+buf.position(), buf.remaining());
        next();
        decodeValue(slimeInserter.adjust(slime));
        if (in.failed()) {
            slime.wrap("partial_result");
            slime.get().setData("offending_input", in.getOffending());
            slime.get().setString("error_message", in.getErrorMessage());
        }
        return slime;
    }
A port of the C++ json decoder intended to be fast.

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