Re: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-05 Thread Juan Pablo Califano
No worries! 2008/10/3, Benny [EMAIL PROTECTED]: There's one problem with using URLVariables: it works on NUL-terminated Strings You're right, so URLVariables is now out of the picture ;-) I think your class would indeed do the job but because I want to keep the client code as light as

RE: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Benny
Thanks Juan Pablo Califano. I'm already sending the data in binary form so that's is probably not the problem. You are right about that the php decompression should be done with gzinflate (I did test with it before but that didn't work either so I thought I should try gzuncompress ;) When I

RE: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Benny
(please ignore previous reply - contained mistakes regarding gzuncompress while I meant gzinflate) Thanks Juan Pablo Califano. I'm already sending the data in binary form so that's is probably not the problem. You are right about that the php decompression should be done with gzinflate (I did

Re: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Juan Pablo Califano
Hi, I think you shouldn't use UTF-8 and mb_ functions. In this scenario, one useful property of the php strings API is that doesn't really understand anything about encodings. A byte is a char and that's all, so you can use that API as if it were acting on raw buffers. In this case, that's what

Re: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Ian Thomas
On Fri, Oct 3, 2008 at 6:36 PM, Benny [EMAIL PROTECTED] wrote: The only problem now is that in the production code I have to send several ByteArray objects to the server in one go. And I have to process them separately in the PHP script. Hence I thought the obvious thing would be to assign

RE: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Benny
We are getting closer ;-) The code you provided worked for me too. When I compare my code to yours I notice that I am using the $_POST array while you are using the PHP input stream. The other major difference is the fact that I am POSTing using via an URLVariables instance. When I change both

Re: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Juan Pablo Califano
There's one problem with using URLVariables: it works on NUL-terminated strings, so if you happen to have a 0 in the compressed data, it will be truncated Some time ago I wrote a class to post data in multipart format (basically, it does the same the browser does when you have a form with a file

RE: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-03 Thread Benny
There's one problem with using URLVariables: it works on NUL-terminated Strings You're right, so URLVariables is now out of the picture ;-) I think your class would indeed do the job but because I want to keep the client code as light as possible I think I'll just send one big compressed

Re: [Flashcoders] how to uncompress a compressed bytearray with PHP

2008-10-02 Thread Juan Pablo Califano
I see a couple of spots for problems in what you are doing. When you're compressing the data, you are basically transforming text strings to binary. I mean, text is binary data, but generally strings cannot contain NUL characters (that is a 0 value), because that's traditionally reserved to mark