Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / September 2007



Tip: Looking for answers? Try searching our database.

Uncompressing socket data from Java

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
masteffens - 31 Aug 2007 23:10 GMT
Has anyone had any luck sending compressed data from java to flash using the
flash.net.Socket class? I am compressing the data on the java side using the
Deflator class which uses zlib compression. Trying to uncompress using
ByteArray.uncompress() and it is failing and throwing an exception saying
unable to uncompress. I would like to find a compression algorithm in java that
matches the one used by ByteArray.uncompress.
the_real_hinkle - 20 Sep 2007 20:25 GMT
I'm have the same problem exactly.  Replace Java Deflater with Python zlib module.
masteffens - 20 Sep 2007 21:46 GMT
I now have it working - the problem was due to the fact that the data is
buffered and sent through in chunks. I had to send through the number of bytes
first, followed by the compressed data. The flash code then appends to a byte
array until it has read all of the bytes and only decompresses when all bytes
have been read. Buffering of data sent over a socket is controlled by the op
sys I think and you can't easily change the buffer size. The other way you
could do it is to append an end token to the compressed data before sending.
The flash code would then keep adding to the ByteArray until it finds the end
token.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.