public static byte[] gzip(String input){
  FastByteArrayOutputStream baos=new FastByteArrayOutputStream();
  PGZIPOutputStream gzos=null;
  try {
    gzos=new PGZIPOutputStream(baos);
    gzos.write(input.getBytes("UTF-8"));
  }
 catch (  IOException e) {
    MainUtil.handleError(e);
  }
 finally {
    if (gzos != null) {
      try {
        gzos.close();
      }
 catch (      IOException ignore) {
      }
    }
  }
  return baos.toByteArray();
}

public static byte [ ] gzip ( String input ) { FastByteArrayOutputStream baos = new FastByteArrayOutputStream ( ) ; PGZIPOutputStream gzos = null ; try { gzos = new PGZIPOutputStream ( baos ) ; gzos . write ( input . getBytes ( "UTF-8" ) ) ; } catch ( IOException e ) { MainUtil . handleError ( e ) ; } finally { if ( gzos != null ) { try { gzos . close ( ) ; } catch ( IOException ignore ) { } } } return baos . toByteArray ( ) ; }
gzip compress a string of bytes .
