Code example for DataOutput

Methods: writeBoolean

0
  /** 
   * GenericCounter ::= keyName isDistinctDisplayName [displayName] value 
   */ 
  @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);
  } 
 
  @Override 
  public synchronized String getName() {
    return name;
  } 
 
  @Override