question: public static byte [ ] compress ( String str ) throws IOException { if ( str == null || str . length ( ) == 0 ) { return null ; } ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; GZIPOutputStream gzip = new GZIPOutputStream ( out ) ; gzip . write ( str . getBytes ( "UTF-8" ) ) ; gzip . close ( ) ; byte [ ] outBytes = out . toByteArray ( ) ; return outBytes ; }
target:  Compresses a given String. It is encoded using ISO-8859-1, So any decompression of the compressed string should also use ISO-8859-1