Code example for DataOutput

Methods: writeDouble, writeInt

0
    this.value = in.readDouble();
  } 
 
  @Override 
  public void write(DataOutput out) throws IOException {
    out.writeInt(key);
    out.writeDouble(value);
  } 
 
  public int getKey() { 
    return key;
  } 
 
  public double getValue() { 
    return value;
  } 
 
}