@Override public void writeString(byte[] str,int offset,int length) throws IOException {
  if (str == null)   writeInt(0);
 else {
    if (useCompression && length >= Compressor.MIN_SIZE_FOR_DEFLATION) {
      if (byteBuffer.length < length)       byteBuffer=new byte[2 * length];
      int numberOfBytes=compressor.deflateString2ByteArray(str,offset,length,byteBuffer);
      writeInt(numberOfBytes);
      io.write(byteBuffer,0,Math.abs(numberOfBytes));
    }
 else {
      writeInt(length);
      io.write(str,offset,length);
    }
  }
}

@ Override public void writeString ( byte [ ] str , int offset , int length ) throws IOException { if ( str == null ) writeInt ( 0 ) ; else { if ( useCompression && length >= Compressor . MIN_SIZE_FOR_DEFLATION ) { if ( byteBuffer . length < length ) byteBuffer = new byte [ 2 * length ] ; int numberOfBytes = compressor . deflateString2ByteArray ( str , offset , length , byteBuffer ) ; writeInt ( numberOfBytes ) ; io . write ( byteBuffer , 0 , Math . abs ( numberOfBytes ) ) ; } else { writeInt ( length ) ; io . write ( str , offset , length ) ; } } }
write a string , compressed , if long enough
