[flexcoders] Reading compressed file in AS 3

2009-02-26 Thread ACasualObserver
I have a program that create an XML string and write it to a file
using either regular file function or zlib file function to create
compressed file. This is done on the server.

On the client, I can read and process the uncompressed file in an AS3
application using URLLoader and URLRequest. I have problem doing the
same with compressed file. The code copies the data correctly to a
ByteArray but uncompress method gives Error #2058: There was an error
decompressing the data. What can be wrong and what is the solution.

In case it is useful, the first 16 bytes of the file in HEX are:

1F 8B 08 00 00 00 00 00 00 0B CC BC 67 AF F4 CC

They match the first 16 bytes of the ByteArray.

Thanks. 



Re: [flexcoders] Reading compressed file in AS 3

2009-02-26 Thread Maciek Sakrejda
What are the other bytes ;) ?

I've run into some issues working with low-level bit-twiddling before
(only on Linux, but that still may be indicative of larger problems).
For example, in FP9 on Linux, sending a payload with a POST URLRequest
truncates the payload data at the first 0x00 byte (!). On FP10 in Linux,
that seems to have been fixed, but I'm getting a different error that I
have not yet tracked down.

I'm not sure if your issue is related, but I'd make sure your data makes
it to the client okay before you try to decompress it. E.g., can you
compute a checksum for both client and server and compare?
-- 
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com

-Original Message-
From: ACasualObserver pof...@yahoo.com
Reply-To: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Reading compressed file in AS 3
Date: Thu, 26 Feb 2009 21:45:19 -

I have a program that create an XML string and write it to a file
using either regular file function or zlib file function to create
compressed file. This is done on the server.

On the client, I can read and process the uncompressed file in an AS3
application using URLLoader and URLRequest. I have problem doing the
same with compressed file. The code copies the data correctly to a
ByteArray but uncompress method gives Error #2058: There was an error
decompressing the data. What can be wrong and what is the solution.

In case it is useful, the first 16 bytes of the file in HEX are:

1F 8B 08 00 00 00 00 00 00 0B CC BC 67 AF F4 CC

They match the first 16 bytes of the ByteArray.

Thanks.