List of utility methods to do GZip String
String | compress(String str) compress if (str == null || str.length() == 0) { return str; ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPOutputStream gzip = new GZIPOutputStream(out); gzip.write(str.getBytes()); gzip.close(); return out.toString("ISO-8859-1"); ... |
String | uncompress(String str) uncompress if (str == null || str.length() == 0) { return str; ByteArrayInputStream in = new ByteArrayInputStream( str.getBytes("UTF-8")); return uncompress(in); |