public byte[] compress(byte[] in,String algorithm){
  int len=in.length;
  if (in.length < 5) {
    algorithm="NO";
  }
  Compressor compress=getCompressor(algorithm);
  byte[] buff=getBuffer((len < 100 ? len + 100 : len) * 2);
  int newLen=compress(in,in.length,compress,buff);
  byte[] out=DataUtils.newBytes(newLen);
  System.arraycopy(buff,0,out,0,newLen);
  return out;
}

public byte [ ] compress ( byte [ ] in , String algorithm ) { int len = in . length ; if ( in . length < 5 ) { algorithm = "NO" ; } Compressor compress = getCompressor ( algorithm ) ; byte [ ] buff = getBuffer ( ( len < 100 ? len + 100 : len ) * 2 ) ; int newLen = compress ( in , in . length , compress , buff ) ; byte [ ] out = DataUtils . newBytes ( newLen ) ; System . arraycopy ( buff , 0 , out , 0 , newLen ) ; return out ; }
compressed the data using the specified algorithm . if no algorithm is supplied , lzf is used
