public int readMixed() throws IOException {
        if (repCount == 0) {
            final boolean negative = decodeBit();
            final int d = decodeVarBits() + diffshift;
            repCount = decodeVarBits() + 1;
            lastValue += negative ? -d : d;
            diffshift = 1;
        }
        repCount--;
        return lastValue;
    }
DataInputStream for decoding fast-compact encoded number sequences

@author ab
main/src/main/java/cgeo/geocaching/brouter/util/MixCoderDataInputStream.java