static byte[] gzipString(S s) ctex { new ByteArrayOutputStream baos; GZIPOutputStream gos = new GZIPOutputStream(baos); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(gos, "UTF-8"); PrintWriter printWriter = new PrintWriter(outputStreamWriter); printWriter.print(s); printWriter.close(); gos.close(); ret baos.toByteArray(); }