public class CompressionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
compressGZip(String input) |
static String |
compressGZipAndBase64Encode(String input)
Compresses and Base64 encodes a String.
|
static String |
decodeAndDecompressGZip(String zippedBase64Str)
Dcompresses a byte array representing a GZip-compressed string back into a String.
|
static boolean |
isCompressed(byte[] bytes) |
static boolean |
isCompressed(String input) |
static String |
toString(InputStream input,
Charset encoding)
Converts an inputstream to a string.
|
public static boolean isCompressed(byte[] bytes)
public static boolean isCompressed(String input)
public static byte[] compressGZip(String input)
public static String compressGZipAndBase64Encode(String input)
input
- the stringpublic static String decodeAndDecompressGZip(String zippedBase64Str)
zippedBase64Str
- the byte array to decompresspublic static String toString(InputStream input, Charset encoding) throws IOException
input
- the input streamencoding
- the EncodingIOException
- exception in case something goes wrong.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries