SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Compression.Deflater for use with action script 3.0 bytearray.uncompress

Last post 10-06-2008 8:40 PM by JohnReilly. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-14-2008 4:42 AM

    Compression.Deflater for use with action script 3.0 bytearray.uncompress

    I am creating the transmitting the compress data to the flash swf file. The transmission works fine.

    here is the vb.net code. the variable resp is the data that needs to be compressed.

    Dim memory As New MemoryStream

    Dim byteValue() As Byte = System.Text.Encoding.ASCII.GetBytes(resp)

    Dim deflater As ICSharpCode.SharpZipLib.Zip.Compression.Deflater = New ICSharpCode.SharpZipLib.Zip.Compression.Deflater(9, True) '

    Dim outStream = New ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream(memory, deflater)

    outStream.IsStreamOwner = False

    outStream.Write(byteValue, 0, byteValue.Length)

    outStream.Flush()

    outStream.Finish()

    outStream = Nothing

    deflater = Nothing

    Dim vStateStr As String = System.Convert.ToBase64String(memory.ToArray())

     -------------------------------

    here is what adobe says about uncompress>

    Flash Player supports only the default algorithm, deflate. The deflate compression algorithm is described at http://www.ietf.org/rfc/rfc1951.txt.

    The uncompress gives this error

    Main Thread (Suspended: Error: Error #2058: There was an error decompressing the data.) 
     flash.utils::ByteArray/uncompress [no source] 

    I can't get the ICSharpCode help file to open any pages so I need some guidance.

    How do i set the properties to obtain a compressed string that is compliant?

  • 10-06-2008 8:40 PM In reply to

    Re: Compression.Deflater for use with action script 3.0 bytearray.uncompress

    Hi,

    I dont know about swf files but there are a couple of things to do.

    1. Can you round trip the files you are creating in #Zip?  ie Create/add and then extract.  This tells you the compression is working.

    2. Can you extract a known good swf file?  If you can create one with known contents and can extract it you can then work on re-creating it.

     

    Something along those lines may help you I think.

    -jr-

     

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.