Note that there are some explanatory texts on larger screens.

plurals
  1. POUncompress a zlib-compressed string in Java
    primarykey
    data
    text
    <p>I have a Java module that is receiving a compressed string from a remote Python script. The Python script compresses the string using <code>zlib.compress()</code>. I simply want to uncompress it in Java and display it to the user.</p> <p>The <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/zip/Deflater.html" rel="nofollow noreferrer">man page</a> for Java's built-in zip.Deflater object describes pretty explicitly how to uncompress something that has been compressed using <code>zlib.compress()</code>. However, this method does not work for me. Depending on which encoding I use, I either get "Incorrect Header Check" errors or the uncompression returns an empty string.</p> <p>So, how am I supposed to uncompress this? The data are not getting corrupted in transmission, and the compressed string begins with "x\x9c", which is apparently appropriate for zlib-compressed stuff.</p> <p>I've never dealt with compression/uncompression on this level before and am getting confused. For extra credit, I'd appreciate an explanation between compressed/uncompressed and inflated/deflated. According to <a href="https://stackoverflow.com/questions/2424945/are-zlib-compress-on-python-and-deflater-deflate-on-java-android-compatible">this</a> they are different, but most of the internet seems to use them interchangeably for zlib. This just makes trying to find a solution even more difficult, as I couldn't tell you whether I'm actually trying to "uncompress" or "inflate" these data.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload