class DLeftCountingBloomFilter {

    protected long getBits(byte[] input, long numBits, int pos) {
        long value = 0;
        long postBits = pos % 8;
        int i = pos/8;
        long start = postBits > numBits ? numBits : postBits;
        
        if (start != 0) {
            value = input[i++] & (0xFF >> (8 - start));
            numBits -= start;
        }
        while (numBits >= 8) {
            value = (value << 8) | input[i++];
            numBits -= 8;
        }
        if (numBits != 0) {
            long last = (input[i] >> (8 - numBits));
            value = (value << numBits) | last;
        }
        return value;
    }

    public  DLeftCountingBloomFilter(int d, int b);

}