RE: [flexcoders] Zlib Compression was Backend Choice...

2006-08-28 Thread Tom Lee












Very useful  



So, for clarification, under what
circumstances will the browser handle decompression of HTTP Compressed data,
and when is it necessary to use ByteArray.compress/uncompress? Im
under the impression that the Flash Player handles communication for the URLStream
and Socket class and the browser handles other communications. Therefore,
I would assume that the ByteArray methods would only be needed for URLStream
and Socket Right?











From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ted Patrick
Sent: Monday, August 28, 2006
10:30 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Zlib
Compression was Backend Choice...





Flash Player 9 supports direct use of zlib compression
independent of the browser!!!



flash.util.ByteArray.compress 

flash.util.ByteArray.uncompress



You can retrieve a ByteArray from flash.net.URLStream and flash.net.Socket.
These allow you to get a bytearray of data directly from any url or TCP based
socket server.



Some useful use patterns:



ZLIB XML  HTTP  URLStream 
ByteArray.uncompress  ByteArray.UTFReadBytes



ZLIB SWF/GIF/JPG/PNG  HTTP  URLStream 
ByteArray.uncompress  Loader.writeBytes( ByteArray.readBytes )



ZLIB AMF  HTTP  URLStream 
ByteArray.uncompress  ByteArray.readObject



ZLIB XML  TCPSocket  Socket 
ByteArray.uncompress  ByteArray.UTFReadBytes



ZLIB SWF/GIF/JPG/PNG  TCPSocket  Socket 
ByteArray.uncompress  Loader.writeBytes( ByteArray.readBytes )



ZLIB AMF  TCPSocket  Socket 
ByteArray.uncompress  ByteArray.readObject



I explored all these patterns in depth during the
evolution of AS3 AVM2 and Flash Player 9.



I have some zlib tools in Python and some examples of
these patterns. I will clean them up and post them to my blog.



Cheers,



Ted Patrick

Flex Evangelist

Adobe Systems Incorporated















From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Lee
Sent: Wednesday, August 23, 2006
11:20 AM
To: flexcoders@yahoogroups.com
Subject: RE: [Junk E-Mail - LOW]
[flexcoders] Re: Choice of backend systems - which provides













Speaking of that  Ive always wondered, is the gzip
decompression handled by the browser, or by the Flash player? Ive
assumed it was the browser (HTTP Compression, right?). That being the
case, arent there some browsers which dont have gzip support, or
are they all dead?

 















__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___





RE: [flexcoders] Zlib Compression was Backend Choice...

2006-08-28 Thread Ted Patrick












Tom,



if ( Browser supports GZIP compression  HTTP Server
supports GZIP compression )

{

 Flash Player will receive decompressed
HTTP data using any HTTP based service!

}



This applies to all HTTP/HTTPS based data transfer. Basically
the browser has the capability to decode GZIP before data is presented to the
player.


URLStream and Socket class support zlib compression independent of the browser
or network protocol in use. You can load data directly from FTP, SVN that is
zlib compressed and decompress in the Flash Player. You can also compress data
in the Flash Player and upload it to a server. Using zlib compression is wide
open in Flash Player.



Also most do not realize that AMF serialization and
deserialization are also added directly into ByteArray. You can read and write
AMF this easily.



import flash.utils.ByteArray;

 

//writing to ByteArray

var byteObj:ByteArray = new ByteArray();

byteObj.writeObject( new Array( Hello, 2, 3,
4, 5 ) );

trace( byteObj.length )

byteObj.writeObject( Hello Write Byte World );


 

// reading ByteArray 

byteObj.position = 0

trace( byteObj.readObject() ); 

trace( byteObj.readObject() );



Its a brand new world folks! Have fun with direct
AMF data access within Flash Player 9 Network transfer of AMF data is orthogonal
to de/serialization in Flash Player 9. That is a major league change. Take a
deeper look at ByteArray there is a ton of real value in this class.



It is Mega-Mega-Useful



Cheers,

Ted Patrick

Flex Evangelist

Adobe Systems Incorporated









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Lee
Sent: Monday, August 28, 2006 8:39
AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Zlib
Compression was Backend Choice...













Very useful  



So, for clarification, under what circumstances will the browser
handle decompression of HTTP Compressed data, and when is it necessary to use
ByteArray.compress/uncompress? Im under the impression that
the Flash Player handles communication for the URLStream and Socket class and
the browser handles other communications. Therefore, I would assume that
the ByteArray methods would only be needed for URLStream and Socket
Right?













__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___