Code example for DataInput

Methods: readDouble, readInt

0
	public double getValue(){ 
		return value;
	} 
	 
	public void readFields(DataInput input) throws IOException {
		this.value = input.readDouble();
		this.label = input.readInt();
	} 
 
	public void write(DataOutput output) throws IOException {
		output.writeDouble(this.value);
		output.writeInt(this.label);
	} 
 
	public int getLabel() { 
		return label;
	} 
 
	public int compareTo(Object o) {
		ValueLabelPair p = (ValueLabelPair)o;
		if (value > p.value) return 1;