According to the
3.0 API, the ByteArray uncompress method will uncompress any
zlib compressed data (select ByteArray from the nav bar on the
left). But I get an error trying to uncompress when I use data that
was zlib compressed, but not by the ByteArray compress method (data
coming in over a socket).
With a little more searching, I found a slightly different
2 API, which states that the uncompress method will only work
with data compressed by the compress method.
So the question is, can I decompress ANY zlib compressed data
or just flash's compressed data?
The ByteArray has to have the entire zlib stream in memory in
order to decompress properly. You can't leave the stream open and
decompress a little bit at a time (as you can with a Java Inflater
If you have control of the zlib compression and want to close
out the stream, check out the Z_FINISH flag.