I come into a trouble implementing a Flex 3.0.0 client that receives compressed HTTP body from server via a socket HTTP library (not class HTTPService
).
First it seems that nginx supports ONLY gzip
compression with gzip on;
. (Correct me if I'm wrong.) So, add HTTP header of Accept-Encoding: gzip
to request.
Then I get a compressed ByteArray
from HTTP response with header Content-Encoding: gzip
.
The problem here is to decompress the compressed data, namely the HTTP body, correctly.
In later version of Flex, there is a function deflate in ByteArray. But it is absent in Flex 3.0.0. Upgrading to higher version is not an option as it would make existing applications unstable with some new seen and unseen bugs.
Is there an alternative way, code or library, to decompress the gzip
data in ByteArray
?