public class CompressionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
compressGZip(String content)
Compresses a given content to a GZipped byte array.
|
static <T> byte[] |
compressGZipGeneric(T object)
Compresses a given object to a GZipped byte array.
|
static byte[] |
decodeBase64(String message)
Decodes the given string using Base64 algorithm.
|
static String |
decompressGZip(byte[] bytes)
Dcompresses a byte array representing a GZip-compressed string back into a String.
|
static <T> T |
decompressGZipGeneric(byte[] bytes)
Dcompresses a byte array representing a GZip-compressed object into an object of the given class type.
|
static String |
encodeBase64(byte[] byteArray)
Encodes the given byte array to Base64.
|
static String |
encodeBase64(String message)
Encodes the given String to Base64.
|
public static <T> byte[] compressGZipGeneric(T object)
throws SerializationException
object - the object to encodeSerializationException - if something goes wrong with the streamspublic static byte[] compressGZip(String content) throws SerializationException
content - the content to encodeSerializationException - if something goes wrong with the streamspublic static <T> T decompressGZipGeneric(byte[] bytes)
throws SerializationException
T - the class type to deserialize the byte array intobytes - the byte array to decompressSerializationException - if something goes wrong with the streamspublic static String decompressGZip(byte[] bytes) throws SerializationException
bytes - the byte array to decompressSerializationException - if something goes wrong with the streamspublic static String encodeBase64(byte[] byteArray)
byteArray - the byte array to encodepublic static String encodeBase64(String message)
message - the byte array to encodepublic static byte[] decodeBase64(String message)
message - String representing the message to decodeCopyright © 2017. All rights reserved.