Package com.tridion.util
Class CompressionUtils
java.lang.Object
com.tridion.util.CompressionUtils
CompressionUtils.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]compressGZip(String input) static StringCompresses and Base64 encodes a String.static StringdecodeAndDecompressGZip(String zippedBase64Str) Dcompresses a byte array representing a GZip-compressed string back into a String.static booleanisCompressed(byte[] bytes) static booleanisCompressed(String input) static StringtoString(InputStream input, Charset encoding) Converts an inputstream to a string.
-
Method Details
-
isCompressed
public static boolean isCompressed(byte[] bytes) -
isCompressed
-
compressGZip
-
compressGZipAndBase64Encode
Compresses and Base64 encodes a String.- Parameters:
input- the string- Returns:
- a string which is GZipped and Base64 encoded.
-
decodeAndDecompressGZip
Dcompresses a byte array representing a GZip-compressed string back into a String.- Parameters:
zippedBase64Str- the byte array to decompress- Returns:
- the deserialized object of the given class type
-
toString
Converts an inputstream to a string.- Parameters:
input- the input streamencoding- the Encoding- Returns:
- the String result
- Throws:
IOException- exception in case something goes wrong.
-