public static void serialize(OutputStream out, BloomKFilter bloomFilter) throws IOException {
    DataOutputStream dataOutputStream = new DataOutputStream(out);
    dataOutputStream.writeByte(bloomFilter.k);
    dataOutputStream.writeInt(bloomFilter.getBitSet().length);
    for (long value : bloomFilter.getBitSet()) {
      dataOutputStream.writeLong(value);
    }
  }
Serialize a bloom filter:
Serialized BloomKFilter format:
1 byte for the number of hash functions.
1 big endian int(That is how OutputStream works) for the number of longs in the bitset
big endian longs in the BloomKFilter bitset

@param out         output stream to write to
@param bloomFilter BloomKFilter that needs to be serialized
storage-api/src/java/org/apache/hive/common/util/BloomKFilter.java