Class CompressionUtil
java.lang.Object
org.apache.commons.jcs3.utils.zip.CompressionUtil
Compress / Decompress.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
compressByteArray
(byte[] input) Compress the byte array passedstatic byte[]
compressByteArray
(byte[] input, int bufferLength) Compress the byte array passedstatic byte[]
decompressByteArray
(byte[] input) Decompress the byte array passed using a default buffer length of 1024.static byte[]
decompressByteArray
(byte[] input, int bufferLength) Decompress the byte array passedstatic byte[]
decompressGzipByteArray
(byte[] compressedByteArray) decompress a gzip byte array, using a default buffer length of 1024static byte[]
decompressGzipByteArray
(byte[] compressedByteArray, int bufferlength) decompress a gzip byte array, using a default buffer length of 1024
-
Method Details
-
decompressByteArray
Decompress the byte array passed using a default buffer length of 1024.- Parameters:
input
- compressed byte array webservice response- Returns:
- uncompressed byte array
-
decompressByteArray
Decompress the byte array passed- Parameters:
input
- compressed byte array webservice responsebufferLength
- buffer length- Returns:
- uncompressed byte array
-
compressByteArray
Compress the byte array passed- Parameters:
input
- byte array- Returns:
- compressed byte array
- Throws:
IOException
- thrown if we can't close the output stream
-
compressByteArray
Compress the byte array passed- Parameters:
input
- byte arraybufferLength
- buffer length- Returns:
- compressed byte array
- Throws:
IOException
- thrown if we can't close the output stream
-
decompressGzipByteArray
decompress a gzip byte array, using a default buffer length of 1024- Parameters:
compressedByteArray
- gzip-compressed byte array- Returns:
- decompressed byte array
- Throws:
IOException
- thrown if there was a failure to construct the GzipInputStream
-
decompressGzipByteArray
public static byte[] decompressGzipByteArray(byte[] compressedByteArray, int bufferlength) throws IOException decompress a gzip byte array, using a default buffer length of 1024- Parameters:
compressedByteArray
- gzip-compressed byte arraybufferlength
- size of the buffer in bytes- Returns:
- decompressed byte array
- Throws:
IOException
- thrown if there was a failure to construct the GzipInputStream
-