I'm working with a system that returns a GZIP string (not a binary or stream) in its response. For example, gzip:H4sIAAAAAAAAALS9665wyXEd9i7zm21U37vnVwwZAREEAZJYgBEjMKq6uiVLNimQlBDRyLtnrX3GD+ACIlEDznyaffbpXV21Vl1W/bdf/vKv/3R/+fWXf/4n17/cX373y/l7/cPfXf+3f/nl1zxWrmW2Vfeev/vlL/p3f/7l1//4f//uF7vvj3+6f/unP/zy63/75T/9p//+CPz97375F/0v//zb3/2q/1X/+sc...
(had to omit the full string as its very long) . I'm able to verify its GZIP compressed since tools such as https://www.multiutil.com/gzip-to-text-decompress/ are returning the expected uncompressed string.
However I'm stuck trying to find a way to handle this string in Java.
I've tried
final GZIPInputStream gzipInput = new GZIPInputStream(new ByteArrayInputStream(compressedString.getBytes()));
but this line is throwing java.util.zip.ZipException: Not in GZIP format
.
I've searched around here but the similar posts are regarding when GZIP is in a http response and can be read from the stream. In my case, my GZIP data is already given to me as a string.
Any pointers would be greatly appreciated, thank you.