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:edu.isi.mavuno.input.TrecDocument.java

License:Apache License

/**
 * Deserializes this object./*from   w  w w.j  av  a 2 s  .  com*/
 */
@Override
public void write(DataOutput out) throws IOException {
    byte[] bytes = mRawDoc.getBytes();
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);
}

From source file:edu.uci.ics.biggraph.io.VIntWritable.java

License:Apache License

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

From source file:edu.umd.cloud9.collection.aquaint2.Aquaint2Document.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    byte[] bytes = raw.getBytes();
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);// w w w  . j  a  va2  s.c o  m
}

From source file:edu.umd.cloud9.collection.line.TextDocument.java

License:Apache License

/**
 * Deserializes this object./*from   ww w  . j a  v a  2 s . co  m*/
 */
public void write(DataOutput out) throws IOException {
    out.writeUTF(mDocid);
    byte[] bytes = mContents.getBytes();
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);
}

From source file:edu.umd.cloud9.collection.medline.MedlineCitation.java

License:Apache License

/**
 * Deserializes this object./*from  www .  j a va  2s .  co m*/
 */
public void write(DataOutput out) throws IOException {
    byte[] bytes = citation.getBytes();
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);
}

From source file:edu.umd.cloud9.collection.spinn3r.Spinn3rItem.java

License:Apache License

public void write(DataOutput out) throws IOException {
    byte[] bytes = mItem.getBytes();
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);/*from  w w w .  j a  va 2s .c  o  m*/
}

From source file:edu.umd.cloud9.collection.trec.TrecDocument.java

License:Apache License

/**
 * Deserializes this object./*w ww  . j a v a 2  s .co  m*/
 */
@Override
public void write(DataOutput out) throws IOException {
    byte[] bytes = doc.getBytes();
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);
}

From source file:edu.umd.cloud9.collection.trecweb.TrecWebDocument.java

License:Apache License

/**
 * Deserializes this object.// ww  w.  j  a va2  s . c  o m
 */
public void write(DataOutput out) throws IOException {
    out.writeUTF(docid);
    byte[] bytes = content.getBytes("UTF-8");
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);
}

From source file:edu.umd.cloud9.collection.wikipedia.WikipediaPage.java

License:Apache License

/**
 * Deserializes this object./*w  ww .j  av  a 2 s. c o m*/
 */
public void write(DataOutput out) throws IOException {
    byte[] bytes = page.getBytes("UTF-8");
    WritableUtils.writeVInt(out, bytes.length);
    out.write(bytes, 0, bytes.length);
    out.writeUTF(language == null ? "unk" : language);
}

From source file:fi.tkk.ics.hadoop.bam.ReferenceFragment.java

License:Open Source License

public void write(DataOutput out) throws IOException {
    sequence.write(out);//from w  ww.  j a va2s  .  c  om

    WritableUtils.writeString(out, indexSequence);
    WritableUtils.writeVInt(out, position);

}