Code example for DataInput

Methods: readBoolean, readFloat, readFully, readInt, readLong

0
    out.writeLong(startTime);
    out.writeLong(finishTime);
    out.writeBoolean(includeCounters);
    out.writeLong(outputSize);
    if (includeCounters) {
      counters.write(out);
    } 
    nextRecordRange.write(out);
  } 
 
  public void readFields(DataInput in) throws IOException {
    this.taskid.readFields(in);
    this.progress = in.readFloat();
    this.numSlots = in.readInt();
    this.runState = WritableUtils.readEnum(in, State.class);
    this.diagnosticInfo = Text.readString(in);
    this.stateString = Text.readString(in);
    this.phase = WritableUtils.readEnum(in, Phase.class); 
    this.startTime = in.readLong(); 
    this.finishTime = in.readLong(); 
    counters = new Counters();
    this.includeCounters = in.readBoolean();
    this.outputSize = in.readLong();
    if (includeCounters) {
      counters.readFields(in);
    } 
    nextRecordRange.readFields(in);
  } 
   
  ////////////////////////////////////////////////////////////////////////////// 
  // Factory-like methods to create/read/write appropriate TaskStatus objects 
  //////////////////////////////////////////////////////////////////////////////