DataOutput writeLong - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DataOutput writeLong method.

This code example shows how to use the following methods:writeInt, writeLong, writeUTF
   
  @Override 
  public void write(DataOutput out) throws IOException {
    LOG.debug("Writing NMTokenIdentifier to RPC layer: " + this);
    ApplicationId applicationId = appAttemptId.getApplicationId();
    out.writeLong(applicationId.getClusterTimestamp());
    out.writeInt(applicationId.getId());
    out.writeInt(appAttemptId.getAttemptId());
    out.writeUTF(this.nodeId.toString());
    out.writeUTF(this.appSubmitter);
    out.writeInt(this.keyId);
  } 
 
  @Override 
  public void readFields(DataInput in) throws IOException {
    appAttemptId =
        ApplicationAttemptId.newInstance( 
            ApplicationId.newInstance(in.readLong(), in.readInt()),
            in.readInt());
    String[] hostAddr = in.readUTF().split(":");
8
CodeRank
This code example shows how to use the following methods:writeLong
    mapFinishTime = in.readLong();
  } 
   
  @Override 
  public void write(DataOutput out) throws IOException {
    super.write(out);
    out.writeLong(mapFinishTime);
  } 
 
  @Override 
  public void addFetchFailedMap(TaskAttemptID mapTaskId) {
    throw new UnsupportedOperationException
                ("addFetchFailedMap() not supported for MapTask"); 
  } 
 
} 
7
CodeRank
This code example shows how to use the following methods:writeLong
  // Writable methods 
  //////////////////////////////////////////// 
 
  @Override 
  public void write(DataOutput out) throws IOException {
    Text.writeString(out, file.toString());
    out.writeLong(start);
    out.writeLong(length);
  } 
 
  @Override 
  public void readFields(DataInput in) throws IOException {
    file = new Path(Text.readString(in));
    start = in.readLong();
    length = in.readLong();
    hosts = null;
  } 
 
  @Override 
  public String[] getLocations() throws IOException {
7
CodeRank
This code example shows how to use the following methods:writeInt, writeLong
  } 
 
  @Override 
  public void write(DataOutput out) throws IOException {
    ApplicationId appId = this.applicationAttemptId.getApplicationId();
    out.writeLong(appId.getClusterTimestamp());
    out.writeInt(appId.getId());
    out.writeInt(this.applicationAttemptId.getAttemptId());
  } 
 
  @Override 
  public void readFields(DataInput in) throws IOException {
    long clusterTimeStamp = in.readLong();
    int appId = in.readInt();
    int attemptId = in.readInt();
    ApplicationId applicationId =
        ApplicationId.newInstance(clusterTimeStamp, appId);
    this.applicationAttemptId =
        ApplicationAttemptId.newInstance(applicationId, attemptId);
  } 
7
CodeRank
This code example shows how to use the following methods:writeInt, writeLong
    mode = CWritableUtils.readString(in);
  } 
 
  @Override 
  public void write(DataOutput out) throws IOException {
    out.writeInt(version);  
    CWritableUtils.writeString(out, path);
    out.writeInt(type);
    out.writeLong(date);
    out.writeLong(length);
    CWritableUtils.writeString(out, user);
    CWritableUtils.writeString(out, group);
    CWritableUtils.writeString(out, mode);
  } 
   
  public int getVersion() { 
    return version;
  } 
  public void setVersion(int version) {
    this.version = version;
7
CodeRank
This code example shows how to use the following methods:writeByte, writeInt, writeLong
    public final static int EXPIRATION_MASK = 0x02;
 
    public void serialize(IColumn column, DataOutput dos)
    { 
        assert column.name().remaining() > 0;
        ByteBufferUtil.writeWithShortLength(column.name(), dos);
        try 
        { 
            if (column instanceof ExpiringColumn) {
              dos.writeByte(EXPIRATION_MASK);
              dos.writeInt(((ExpiringColumn) column).getTimeToLive());
              dos.writeInt(column.getLocalDeletionTime());
            } else { 
              dos.writeByte((column.isMarkedForDelete()) ? DELETION_MASK : 0);
            } 
            dos.writeLong(column.timestamp());
            ByteBufferUtil.writeWithLength(column.value(), dos);
        } 
        catch (IOException e)
        { 

7
CodeRank
This code example shows how to use the following methods:writeInt, writeLong
    mount = CWritableUtils.readString(in);
  } 
   
  @Override 
  public void write(DataOutput out) throws IOException {
    CWritableUtils.writeString(out, filesystem);
    out.writeLong(capacity);
    out.writeLong(used);
    out.writeLong(available);
    out.writeInt(percentUsed);
    CWritableUtils.writeString(out, mount);    
  } 
} 
7
CodeRank
This code example shows how to use the following methods:writeInt, writeLong
    fileCount = in.readInt();
    fileSize = in.readLong();
  } 
   
  public void write(DataOutput out) throws IOException {
    CWritableUtils.writeString(out, maxTxId);    
    CWritableUtils.writeString(out, hostName);    
    out.writeInt(maxSeq);
    out.writeInt(fileCount);
    out.writeLong(fileSize);
  } 
 
  public boolean isNeedCompaction() { 
    return needCompaction;
  } 
 
  public void setNeedCompaction(boolean needCompaction) {
    this.needCompaction = needCompaction;
  } 
 
7
CodeRank
This code example shows how to use the following methods:writeLong
  } 
 
  /** {@inheritDoc} */ 
  @Override 
  public void write(DataOutput out) throws IOException {
    SummationWritable.write(sigma, out);
    out.writeLong(duration);
  } 
   
  /** {@inheritDoc} */ 
  @Override 
  public String toString() {
    return "sigma=" + sigma + ", duration=" + duration + "(" + Util.millis2String(duration) + ")";
  } 
 
  /** Covert a String to a TaskResult */ 
  public static TaskResult valueOf(String s) {
    int i = 0;
    int j = s.indexOf(", duration=");
    if (j < 0)
7
CodeRank
This code example shows how to use the following methods:write, writeLong
  } 
 
  public void write(DataOutput out) throws IOException {
//    rowKey.write(out); 
//    columnKey.write(out); 
    CWritableUtils.writeVInt(out, rowKey.length);
    out.write(rowKey, 0, rowKey.length);    
    CWritableUtils.writeVInt(out, cellKey.length);
    out.write(cellKey, 0, cellKey.length);    
 
    out.writeLong(timestamp);
    out.writeLong(offset);
  } 
   
  public void read(DataInput in) throws IOException {
//    rowKey.readFields(in); 
//    columnKey.readFields(in); 
    int length = CWritableUtils.readVInt(in);
    rowKey = new byte[length];
    in.readFully(rowKey, 0, length);
7
CodeRank
writeLong Method Overview
Writes a long value, which is comprised of eight bytes, to the output stream.
See Code Examples for other Java 8 DataOutput Methods: