Code example for DataInput

Methods: readBoolean

0
    return "" + (isTableSplit ? tableSplit : snapshotSplit);
  } 
 
  @Override 
  public void readFields(DataInput in) throws IOException {
    super.readFields(in);
    this.isTableSplit = in.readBoolean();
    if (this.isTableSplit) {
      tableSplit.readFields(in);
    } else { 
      snapshotSplit.readFields(in);
    } 
  } 
 
  @Override 
  public void write(DataOutput out) throws IOException {
    super.write(out);
    out.writeBoolean(isTableSplit);
    if (isTableSplit) {
      tableSplit.write(out);