Code example for DataOutput

Methods: writeBoolean

0
  /** 
   * Write the binary representation of the counter 
   */ 
  @Override 
  public synchronized void write(DataOutput out) throws IOException {
    Text.writeString(out, name);
    boolean distinctDisplayName = ! name.equals(displayName);
    out.writeBoolean(distinctDisplayName);
    if (distinctDisplayName) {
      Text.writeString(out, displayName);
    } 
    WritableUtils.writeVLong(out, value);
  } 
 
  public synchronized String getName() {
    return name;
  } 
 
  /** 
   * Get the name of the counter. 
   * @return the user facing name of the counter