public void encodeBit(final boolean value) throws IOException {
        if (bm == 0x100) {
            writeByte((byte) b);
            bm = 1;
            b = 0;
        }
        if (value) {
            b |= bm;
        }
        bm <<= 1;
    }
DataOutputStream for fast-compact encoding of number sequences

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