code: public void writeCompressedUTF(String str, int slot) throws IOException {
  		if(slot<0 || slot>0x3f) throw new IOException("Slot out of range (0-63): "+slot);
  		if(lastStrings==null) lastStrings=new String[64];
  		String last=lastStrings[slot];
  		if(last==null) last="";
  		int strLen=str.length();
  		int lastLen=last.length();
  		int maxCommon=Math.min(strLen, lastLen);
  		int common=0;
  		for(;common<maxCommon;common++) {
  			if(str.charAt(common)!=last.charAt(common)) break;
  		}
  		if(lastCommonLengths==null) lastCommonLengths=new int[64];
  		int commonDifference=common-lastCommonLengths[slot];
  
  		// Write the header byte
  		out.write(
  			(commonDifference==0?0:0x80)
  			| (common==strLen?0:0x40)
  			| slot
  		);
  
  		// Write the common difference
  		if(commonDifference>0) writeCompressedInt(commonDifference-1);
  		else if(commonDifference<0) writeCompressedInt(commonDifference);
  
  		// Write the suffix
  		if(common!=strLen) writeUTF(str.substring(common));
  
  		// Get ready for the next call
  		lastStrings[slot]=str;
  		lastCommonLengths[slot]=common;
  	}
docs: Writes a String to the stream while using prefix compression.
  
  <pre>
  The first byte has these bits:
  
  X X X X X X X X
  | | +-+-+-+-+-+ Slot number (0-63)
  | +------------ 1 = Suffix UTF follows, 0 = No suffix UTF exists
  +-------------- 1 = Common length difference follows, 0 = Common length not changed
  
  Second, if common length difference is not zero, the common length change follows
  one less for positive differences because 0 is handled in first byte
  
  Third, if suffix UTF follows, writeUTF of all the string after common length
  </pre>