}
}
public static void main(String[] args) throws Throwable
{
BloomFilter bf = new BloomFilter(1024*1024, 15);
for ( int i = 0; i < 1024*1024; ++i )
{
bf.add(Integer.toString(i));
}
DataOutputBuffer bufOut = new DataOutputBuffer();
BloomFilter.serializer().serialize(bf, bufOut);
FileOutputStream fos = new FileOutputStream("C:\\Engagements\\bf.dat", true);
fos.write(bufOut.getData(), 0, bufOut.getLength());
fos.close();
FileInputStream fis = new FileInputStream("C:\\Engagements\\bf.dat");
byte[] bytes = new byte[fis.available()];
fis.read(bytes);
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(bytes, bytes.length );
BloomFilter bf2 = BloomFilter.serializer().deserialize(bufIn);
int count = 0;
for ( int i = 0; i < 1024*1024; ++i )
{
if ( bf.isPresent(Integer.toString(i)) )