Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET PRoblems unzipping from MemoryStream

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20032 |

    A currently have a memorystream that contains a zip file.  This code is running on a windows CE device, so I am doing a lot of this due to size restrictions on the RAM and storage available at runtime.  Let me give a quick rundown of the process that is going on here:

    1. Operator wants to load a new windows CE “Image” onto the device.  This image is 64Mb and is an exact image of the entire Flash file system of the device.  As you can imagine, since the whole device only has 265Mb of RAM that there would need to be some maneuvering.

    2. Operator uses the web page to download the 64Mb image that is zipped to 13Mb.

    3. The file is transfered to the device using HTTP over a network stream.

    4. The NetworkStream is copied to a temp file (The temp file contains the actual zip file + other assorted HTTP header data)

    5. The Temp file is parsed and the actual image file is copied to the memorystream

    6. This is the memorystream that needs to be decompressed

     
    I have a few ultimate goals:

    Goal 1:

     Unzip the memoryStream to a uncompressed file.  I am currently trying to do this, but I must be doing something wrong.  Here is the Code (Some was taken from the forum, or help examples):

    If m_FileUploadMemoryStream.Length > 0 Then
    Dim zippedStream As New Xceed.FileSystem.StreamFile(m_FileUploadMemoryStream)
    Dim zip As New ZipArchive(zippedStream)
    zip.CopyFilesTo(New DiskFolder(JCID_UPDATE_UNCOMPRESSED_IMAGE_LOCATION), False, True)
    End If
     

    This does not work.  The CopyFilesTo() is executed and execution just goes to the next line.  It seems that nothing is happening there.  Is there an error code that I can check?  I saw some examples in the forums of using a buffer to copy over to another stream, but I am not sure if that is what I would need to do here.

    Goal 2:

     If I can get Goal 1 satisfied, I would like to find out a better use of my available RAM and memory storage use while getting this zip file.  I am looking to see if I can start decompressing directly from the
    networkstream, or some other place so as to utilize the Xceed zip library to its fullest 

     

    Tom

     

    Imported from legacy forums. Posted by Thomas (had 1415 views)

    User (Old forums)
    Member
    Post count: 23064

    The code seems fine.  For exceptions, you can handle the ItemException event on ZipEvents.

    e.g.:

    ZipEvents events = new ZipEvents();

    events.ItemException +=

    new ItemExceptionEventHandler( events_ItemException );

    zip.CopyFilesTo( events,

    null, destFolder, false, true );

     

    static void events_ItemException( object sender, ItemExceptionEventArgs e )

    {

    System.Diagnostics.

    Debug.WriteLine( e.Exception.ToString() );

    }

    Imported from legacy forums. Posted by André (had 1265 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.