Code example for DataInput

Methods: readDouble, readLong

0
	 
	protected double r;
	 
	@Override 
	public void readFields(DataInput in) throws IOException {
		p = in.readLong();
		s = in.readDouble();
		r = in.readDouble();
	} 
 
	@Override 
	public void write(DataOutput out) throws IOException {
		out.writeLong(p);
		out.writeDouble(s);
		out.writeDouble(r);
	} 
 
	public void set(long p, double s, double r){
		this.p = p;
		this.s = s;
		this.r = r;