2 Replies Latest reply on Mar 5, 2009 9:09 AM by JBRyu

    String Compression using ZIP


      Is it possible to compress and decompress strings using ZIP in a flex application, but not AIR?

      In my recent project, I need to send a compressed string in byte-level from a flex application to a server in order to optimize bandwidth. As far as I know, there is only a way to compress string using DEFLATE in flex application, but my server application can't decompress the compressed string because it is a unique web-server written in Delphi. So, I want to implement my own ZIP methods to compress and decompress string. Is there anyone who already implements this method?

        • 1. Re: String Compression using ZIP
          atta707 Level 2
          You can use FZip to compress strings before you send them to the srever:


          • 2. Re: String Compression using ZIP
            Is it really possible to compress strings using FZip?
            It seems that FZip and FZipFile classes work with ZIP archive so that I can create an archive file which contains files and directories, but I can't create a compressed string in ByteArray. I look at the source code for a couple of days but couldn't figure out how to compress strings. For instance, I'm looking for the below codes.

            var s:String = "Hello World!";
            var ba:ByteArray = new ByteArray ();
            ba.endian = Endian.LITTLE_ENDIAN;
            ba.writeMultiByte(s, "us-ascii");
            ba.compress(); // Here, I want to create a custom "compress()" function using FZip. Is it possible?

            Any help?

            Thank everyone!