public class ZipUtil
extends java.lang.Object
Constructor and Description |
---|
ZipUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
compress(java.lang.String str)
Deprecated.
|
static java.lang.String |
decompress(java.lang.String str)
Deprecated.
|
static java.lang.Object |
unZip(java.lang.String zippedOutputData,
java.lang.Class<?> classname)
Extract the object from the compressed string
|
static java.lang.Object |
unZipByteArray(byte[] zippedOutputData)
Extract the object from the byte array
|
static java.lang.Object |
unZipByteArray(byte[] zippedOutputData,
java.lang.Class<?> classname)
Extract the object from the byte array
|
static java.lang.String |
zip(java.lang.Object obj)
Compress the object to String.
|
static byte[] |
zipAsByteArray(java.lang.Object obj)
Compress the object to byte array.
|
@Deprecated public static java.lang.String compress(java.lang.String str)
str
- the data to compress@Deprecated public static java.lang.String decompress(java.lang.String str)
str
- the compressed datapublic static java.lang.String zip(java.lang.Object obj) throws java.io.IOException
obj
- the object to compressjava.io.IOException
- when the compression failspublic static java.lang.Object unZip(java.lang.String zippedOutputData, java.lang.Class<?> classname) throws java.lang.Exception
zippedOutputData
- compressed dataclassname
- the class name of the extracted objectjava.lang.Exception
- when the data extraction failspublic static byte[] zipAsByteArray(java.lang.Object obj) throws java.io.IOException
obj
- the object to compressjava.io.IOException
- when the compression failspublic static java.lang.Object unZipByteArray(byte[] zippedOutputData, java.lang.Class<?> classname) throws java.lang.Exception
zippedOutputData
- the byte arrayclassname
- the class name of the extracted objectjava.lang.Exception
- when the data extraction failspublic static java.lang.Object unZipByteArray(byte[] zippedOutputData) throws java.lang.Exception
zippedOutputData
- the byte arrayjava.lang.Exception
- when the data extraction fails