private static byte[] compress(byte[] d){
  Deflater deflater=new Deflater();
  deflater.setStrategy(Deflater.HUFFMAN_ONLY);
  deflater.setInput(d);
  deflater.finish();
  ByteArrayOutputStream out2=new ByteArrayOutputStream(d.length);
  byte[] buffer=new byte[1024];
  while (!deflater.finished()) {
    int count=deflater.deflate(buffer);
    out2.write(buffer,0,count);
  }
  deflater.end();
  return out2.toByteArray();
}

private static byte [ ] compress ( byte [ ] d ) { Deflater deflater = new Deflater ( ) ; deflater . setStrategy ( Deflater . HUFFMAN_ONLY ) ; deflater . setInput ( d ) ; deflater . finish ( ) ; ByteArrayOutputStream out2 = new ByteArrayOutputStream ( d . length ) ; byte [ ] buffer = new byte [ 1024 ] ; while ( ! deflater . finished ( ) ) { int count = deflater . deflate ( buffer ) ; out2 . write ( buffer , 0 , count ) ; } deflater . end ( ) ; return out2 . toByteArray ( ) ; }
compress the hash description using a huffman coding .
