Example usage for org.apache.lucene.store DataOutput writeInt

List of usage examples for org.apache.lucene.store DataOutput writeInt

Introduction

In this page you can find the example usage for org.apache.lucene.store DataOutput writeInt.

Prototype

public void writeInt(int i) throws IOException 

Source Link

Document

Writes an int as four bytes.

Usage

From source file:org.elasticsearch.common.util.BloomFilter.java

License:Apache License

public static void serilaize(BloomFilter filter, DataOutput out) throws IOException {
    out.writeInt(0); // version

    BitArray bits = filter.bits;/*from   w  w  w . j av a  2  s  .  c o m*/
    out.writeInt(bits.data.length);
    for (long l : bits.data) {
        out.writeLong(l);
    }

    out.writeInt(filter.numHashFunctions);

    out.writeInt(0); // hashType
}

From source file:org.elasticsearch.index.translog.Checkpoint.java

License:Apache License

private void write(DataOutput out) throws IOException {
    out.writeLong(offset);/*w w w  .java2  s. com*/
    out.writeInt(numOps);
    out.writeLong(generation);
}