Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET real-time unzipping causing errors

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #19923 |

    We have an application that runs as a biztalk custom pipeline component. This causes some specific issues.

    We were using the XCeed.Zip library but the stream passed into our component from biztalk doesn’t support all the operations that the zip library needs. for a while we were copying the biztalk stream to a memory stream then passing it to the Xceed.Zip files. this was very inefficient. when we saw the real-time zip this seemed the answer.

    We implemented this and things ran fine with a zip file I created myself using winrar. No more copying the bytes from the biztalk stream to a memorystream. But when we used a production zip from our client, we received a “Expected end of stream not found” error. In Biztalk this error wasn’t thrown, but instead we received “CompressionMethod 1 not supported by ZipReader”. I’m assuming the issue is that the real time zip libs can’t read this particular zip format. Due to HIPAA i cannot provide an example of the zip file at this time, but I can say that it was produced by the product MyZippa v3.5.2.271.

    Any idea if this is a known non-feature in the real-time zip library?

    Here is the code I’m using. Line 47 is where I get the “end of stream” error.

    Xceed.Zip.ReaderWriter.ZipReader zr = new Xceed.Zip.ReaderWriter.ZipReader(data, “passwordhere”);

    ZipItemLocalHeader zipItemLocalHeader = null;
    while((zipItemLocalHeader = zr.ReadItemLocalHeader()) != null)
    byte[] buffer = new byte[1024];
    int read = 0;

    string TempFileName = dir.FullName + “\\” + zipItemLocalHeader.FileName;
    FileInfo fi = new FileInfo(TempFileName);
    using (FileStream fs = fi.Create())
    while ((read = zr.ReadItemData(buffer, 0, buffer.Length)) > 0)
    fs.Write(buffer, 0, read);

    Imported from legacy forums. Posted by Joe (had 2900 views)

    Xceed Support
    Post count: 5658

    Real-Time Zip does not support Stored (1) CompressionMethod. The compression utility you use probably avoid compression for small files or folder entries, which is not supported by Real-Time Zip.

    Imported from legacy forums. Posted by Chris [Xceed] (had 237 views)

    User (Old forums)
    Post count: 23064

    we have adjusted to only use zips that appear to be the right compression method (which is about 1% of all the possible formats of zip i can create using winzip, winrar, or 7zip) and we are still having problems. generally when unzipping, using sample code provided, the zip library wants to unzip an additional file that doesn’t exist in the archive after all other files have been unzipped. this file has a file name of the null character (hex 0), which causes the process to bomb.

    I coded around this by checking the file names before trying to unzip that “file”.

    now I get occasional “expected end of stream not found” or index out of bounds or something like that.

    Imported from legacy forums. Posted by Joe (had 4108 views)

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