Example usage for com.google.common.hash BloomFilter writeTo

List of usage examples for com.google.common.hash BloomFilter writeTo

Introduction

In this page you can find the example usage for com.google.common.hash BloomFilter writeTo.

Prototype

public void writeTo(OutputStream out) throws IOException 

Source Link

Document

Writes this BloomFilter to an output stream, with a custom format (not Java serialization).

Usage

From source file:org.veronicadb.core.memorygraph.VSubGraph.java

/**
 * @return bytes of the Bloom Filter/*ww w .  j a  v a 2 s. c  o m*/
 * @throws IOException
 */
public byte[] getBloomBytes() throws IOException {
    ByteArrayOutputStream os = new ByteArrayOutputStream(1000);
    BloomFilter<Long> clone = null;
    synchronized (subGraphBloom) {
        clone = subGraphBloom.copy();
    }
    clone.writeTo(os);
    return os.toByteArray();
}