Example usage for java.io DataOutput writeInt

List of usage examples for java.io DataOutput writeInt

Introduction

In this page you can find the example usage for java.io DataOutput writeInt.

Prototype

void writeInt(int v) throws IOException;

Source Link

Document

Writes an int value, which is comprised of four bytes, to the output stream.

Usage

From source file:org.cloudata.core.client.CellValueMatcherInfo.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(this.version);

    int classCount = classNames.size();
    out.writeInt(classCount);//from  w ww  .j  a  v a  2 s  .  c  o m

    for (int i = 0; i < classCount; i++) {
        CWritableUtils.writeString(out, classNames.get(i));
        byte[] classByte = classBytes.get(i);
        out.writeInt(classByte.length);
        out.write(classByte);
    }
}

From source file:org.apache.tez.runtime.api.impl.TestTezEvent.java

private void serializeEvents(ArrayList<TezEvent> events, DataOutput out) throws IOException {
    out.writeInt(events.size());
    for (TezEvent e : events) {
        e.write(out);/*from  www  .  jav a2s  .  c om*/
    }
}

From source file:org.apache.hadoop.hbase.index.IndexedHTableDescriptor.java

/**
 * @param DataOutput stream/*from w ww. j av a 2 s  .  co m*/
 */
public void write(DataOutput out) throws IOException {
    super.write(out);
    out.writeInt(this.indices.size());
    for (IndexSpecification index : indices) {
        index.write(out);
    }
}

From source file:org.apache.mahout.classifier.df.node.Node.java

@Override
public final void write(DataOutput out) throws IOException {
    out.writeInt(getType().ordinal());
    writeNode(out);/*from w w  w.  ja v a 2s.co  m*/
}

From source file:com.aliyun.openservices.tablestore.hadoop.MultiCriteria.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeByte(WritableConsts.MULTI_CRITERIA);
    out.writeInt(criteria.size());
    for (RangeRowQueryCriteria c : criteria) {
        new RangeRowQueryCriteriaWritable(c).write(out);
    }//w ww.j  a v  a  2  s .c  o  m
}

From source file:com.marklogic.mapreduce.DatabaseDocument.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(contentType.ordinal());
    WritableUtils.writeVInt(out, content.length);
    out.write(content, 0, content.length);
}

From source file:uk.bl.wa.hadoop.indexer.WritableSolrRecord.java

@Override
public void write(DataOutput output) throws IOException {
    byte[] bytes = SerializationUtils.serialize(this.sr.getSolrDocument());
    output.writeInt(bytes.length);
    output.write(bytes);//ww  w  .  j  a v a  2  s .co m
}

From source file:com.kylinolap.dict.lookup.SnapshotTable.java

void writeData(DataOutput out) throws IOException {
    out.writeInt(rows.size());
    if (rows.size() > 0) {
        int n = rows.get(0).length;
        out.writeInt(n);/*from   ww  w  . j  a v a  2 s  . c o m*/
        for (int i = 0; i < rows.size(); i++) {
            String[] row = rows.get(i);
            for (int j = 0; j < n; j++) {
                out.writeUTF(row[j]);
            }
        }
    }
}

From source file:org.apache.hadoop.hbase.filter.RowListFilter.java

@Override
public void write(DataOutput dout) throws IOException {
    dout.writeInt(bytesSetIterator.previousIndex());
    dout.writeInt(bytesSet.size());//from  w  w  w . ja v  a  2  s  . c  o  m
    for (byte[] bytes : bytesSet) {
        dout.writeShort(bytes.length);
        dout.write(bytes, 0, bytes.length);
    }
}

From source file:com.chinamobile.bcbsp.comm.BSPMessagesPack.java

@Override
public void write(DataOutput out) throws IOException {
    int i = 0;/* www. j a  v a2  s.com*/
    Iterator<IMessage> bspMsgs = pack.iterator();
    out.writeInt(pack.size());
    try {
        while (bspMsgs.hasNext()) {
            IMessage bspMsg = bspMsgs.next();
            bspMsg.write(out);
        }
    } catch (Exception e) {
        throw new RuntimeException("[RPC BSPMsgPack  write Exception]", e);
    }
    return;
}