public int deflateString2ByteArray(String inputString,byte[] bytes){
  byte[] input;
  try {
    input=inputString.getBytes("UTF-8");
  }
 catch (  UnsupportedEncodingException e) {
    input=new byte[inputString.length()];
    for (int i=0; i < bytes.length; i++)     input[i]=(byte)inputString.charAt(i);
  }
  return deflateString2ByteArray(input,0,input.length,bytes);
}

public int deflateString2ByteArray ( String inputString , byte [ ] bytes ) { byte [ ] input ; try { input = inputString . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { input = new byte [ inputString . length ( ) ] ; for ( int i = 0 ; i < bytes . length ; i ++ ) input [ i ] = ( byte ) inputString . charAt ( i ) ; } return deflateString2ByteArray ( input , 0 , input . length , bytes ) ; }
compresses a string to an array of bytes
