bits-and-blooms/bloom

is there a way to save results to disk when reboot?

Opened this issue · 1 comments

is there a way to save results to disk when reboot?

yeah it seems like you can call WriteTo and define a file to write the binary contents to

bloom/bloom.go

Lines 355 to 366 in 1b8b697

func (f *BloomFilter) WriteTo(stream io.Writer) (int64, error) {
err := binary.Write(stream, binary.BigEndian, uint64(f.m))
if err != nil {
return 0, err
}
err = binary.Write(stream, binary.BigEndian, uint64(f.k))
if err != nil {
return 0, err
}
numBytes, err := f.b.WriteTo(stream)
return numBytes + int64(2*binary.Size(uint64(0))), err
}