Code example for DataInput

Methods: readLong, readUTF

0
	} 
	 
	@Override 
	public void readFields(DataInput arg0) throws IOException
	{ 
		term = arg0.readUTF();
		doc = arg0.readLong();
	} 
 
	@Override 
	public void write(DataOutput arg0) throws IOException
	{ 
		arg0.writeUTF(term);
		arg0.writeLong(doc);
	} 
 
	@Override 
	public int compareTo(TermDocWritable arg0)
	{ 
		int val = new Long(doc).compareTo(arg0.doc);
		if (val == 0)