Version 4.0.0: java.awt dependencies move
[nikiroo-utils.git] / src / be / nikiroo / utils / StringUtils.java
index acd632aa1968c50fa631131b3f9b216da6e2f001..a6117a04053e863b3d9952c4fccd33f0533f33c7 100644 (file)
@@ -300,6 +300,14 @@ public class StringUtils {
                                HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
        }
 
+       /**
+        * Zip the data and then encode it into Base64.
+        * 
+        * @param data
+        *            the data
+        * 
+        * @return the Base64 zipped version
+        */
        public static String zip64(String data) {
                try {
                        return Base64.encodeBytes(data.getBytes(), Base64.GZIP);
@@ -309,6 +317,17 @@ public class StringUtils {
                }
        }
 
+       /**
+        * Unconvert from Base64 then unzip the content.
+        * 
+        * @param data
+        *            the data in Base64 format
+        * 
+        * @return the raw data
+        * 
+        * @throws IOException
+        *             in case of I/O error
+        */
        public static String unzip64(String data) throws IOException {
                ByteArrayInputStream in = new ByteArrayInputStream(Base64.decode(data,
                                Base64.GZIP));