@Override
    public void flush() throws IOException {
        final int v = lastValue;
        writeMixed(v + 1);
        lastValue = v;
        repCount = 0;
        if (bm > 1) {
            writeByte((byte) b); // flush bit-coding
        }
    }
DataOutputStream for fast-compact encoding of number sequences

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