Code example for DataOutput

Methods: writeLong, writeUTF

0
	} 
 
	@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)
		{ 
			val = term.compareTo(arg0.term);
		} 
		 
		return val;
	}