class CountingBytesSource extends AbstractChainedSource<byte[], byte[], byte[], byte[]> implements HashedKeySource<byte[], byte[]> {

    @Override
    public void put(byte[] key, byte[] val) {
        if (val == null) {
            delete(key);
            return;
        }

        synchronized (this) {
            byte[] srcVal = getSource().get(key);
            int srcCount = decodeCount(srcVal);
            if (srcCount >= 1) {
                if (filter != null) filter.insert(key);
                dirty = true;
            }
            getSource().put(key, encodeCount(val, srcCount + 1));
        }
    }

    public  CountingBytesSource(Source<byte[], byte[]> src);
    public  CountingBytesSource(Source<byte[], byte[]> src, boolean bloom);

}