Example usage for org.apache.hadoop.io WritableUtils writeVInt

List of usage examples for org.apache.hadoop.io WritableUtils writeVInt

Introduction

In this page you can find the example usage for org.apache.hadoop.io WritableUtils writeVInt.

Prototype

public static void writeVInt(DataOutput stream, int i) throws IOException 

Source Link

Document

Serializes an integer to a binary stream with zero-compressed encoding.

Usage

From source file:org.terrier.structures.postings.bit.BlockIterablePosting.java

License:Mozilla Public License

@Override
public void write(DataOutput out) throws IOException {
    super.write(out);
    WritableUtils.writeVInt(out, positions.length);
    for (int pos : positions)
        WritableUtils.writeVInt(out, pos);
}

From source file:org.terrier.structures.postings.bit.FieldIterablePosting.java

License:Mozilla Public License

/** Write this posting to specified outputstream */
@Override/*from w  w  w  .  j  a v  a  2 s  .  c  om*/
public void write(DataOutput out) throws IOException {
    super.write(out);
    WritableUtils.writeVInt(out, fieldFrequencies.length);
    for (int field_f : fieldFrequencies)
        WritableUtils.writeVInt(out, field_f);
}

From source file:org.terrier.structures.postings.BlockFieldPostingImpl.java

License:Mozilla Public License

@Override
public void write(DataOutput out) throws IOException {
    super.write(out);
    WritableUtils.writeVInt(out, fieldFrequencies.length);
    for (int field_f : fieldFrequencies)
        WritableUtils.writeVInt(out, field_f);
}

From source file:org.terrier.structures.postings.BlockPostingImpl.java

License:Mozilla Public License

/** {@inheritDoc} */
@Override/*from   ww  w .  ja v  a2s  .  c om*/
public void write(DataOutput out) throws IOException {
    super.write(out);
    WritableUtils.writeVInt(out, positions.length);
    for (int pos : positions)
        WritableUtils.writeVInt(out, pos);
}

From source file:org.testies.RelativeKey.java

License:Apache License

private void write(DataOutput out, ByteSequence bs) throws IOException {
    WritableUtils.writeVInt(out, bs.length());
    out.write(bs.getBackingArray(), bs.offset(), bs.length());
}

From source file:parquet.hive.writable.BigDecimalWritable.java

License:Apache License

@Override
public void write(final DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, scale);
    WritableUtils.writeVInt(out, internalStorage.length);
    out.write(internalStorage);//from   w  w  w  . ja v a  2s. com
}

From source file:redpoll.text.OpenBitSetWritable.java

License:Apache License

public void write(DataOutput out) throws IOException {
    long[] bits = bitset.getBits();
    WritableUtils.writeVInt(out, bits.length);
    for (int i = 0; i < bits.length; i++) {
        out.writeLong(bits[i]);/*from w ww . j a  v  a2 s. c  o  m*/
    }
}

From source file:redpoll.text.TfWritable.java

License:Apache License

public void write(DataOutput out) throws IOException {
    documentId.write(out);
    WritableUtils.writeVInt(out, tf.get());
}

From source file:uk.ac.cam.eng.extraction.hadoop.datatypes.FeatureMap.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, instance.size());
    for (Entry<IntWritable, DoubleWritable> entry : instance.entrySet()) {
        WritableUtils.writeVInt(out, entry.getKey().get());
        entry.getValue().write(out);/*from   www. j  av a 2 s .  c om*/
    }
}

From source file:uk.ac.cam.eng.extraction.hadoop.datatypes.TargetFeatureList.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, instance.size());
    for (Pair<Text, AlignmentAndFeatureMap> entry : instance) {
        entry.getFirst().write(out);/*  w ww  .  ja  v a  2 s.  co  m*/
        entry.getSecond().write(out);
    }
}