| 45 | protected long popcount = -1; |
| 46 | |
| 47 | public BloomFilter(long size, int numHash, HashFunction hashFunction) { |
| 48 | |
| 49 | this.size = size; |
| 50 | try { |
| 51 | //System.out.println("unsafe"); |
| 52 | this.bitArray = new UnsafeBitBuffer(size); |
| 53 | } |
| 54 | catch(NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { |
| 55 | this.bitArray = new LargeBitBuffer(size); |
| 56 | } |
| 57 | this.numHash = numHash; |
| 58 | this.hashFunction = hashFunction; |
| 59 | } |
| 60 | |
| 61 | private static final String LABEL_SEPARATOR = ":"; |
| 62 | private static final String LABEL_SIZE = "size"; |