@ SneakyThrows public static String decompress ( final String zippedBase64Str ) { val bytes = EncodingUtils . decodeBase64 ( zippedBase64Str ) ; try ( val zi = new GZIPInputStream ( new ByteArrayInputStream ( bytes ) ) ) { return IOUtils . toString ( zi , Charset . defaultCharset ( ) ) ; } }
First decode base64 String to byte array then use ZipInputStream to revert the byte array to a string .