Code example for DataOutput

Methods: writeLongwriteUTF

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;
	} 
Experience pair programming with AI  Get Codota for Java