Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Issue with stream unzip for large files (more than 3 Gb or so)

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20562 |

    We are using XCeed.Zip 3.5 in backup /restore software, but testing on 5.8 gave same results. Unzipping large files (more than 3 GB) always cause System.OverflowException – “Arithmetic operation resulted in an overflow” (whereas we do not have any problem with smaller files)

    Stacktrace:

        at Xceed.Zip.ItemHeader.ReadDescriptorHeader(BinaryReader reader)
       at Xceed.Zip.ReaderWriter.ZipReader.ReadItemDataDescriptorHeader(ReaderWriterItemInfo itemInfo)
       at Xceed.Zip.ReaderWriter.ZipReader.ReadItemData(Byte[] buffer, Int32 offset, Int32 count)
       at Xceed.Zip.ReaderWriter.ZipReader.ReadItemData(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
       at Xceed.Zip.ReaderWriter.ZipReader.ReadItemData(Stream stream, Int32 bufferSize)
       at Xceed.Zip.ReaderWriter.ZipReader.ReadItemData(Stream stream)
       at PlayWithXceed.XceedStream.UnzipFileStream() in c:\Users\Sergius\Documents\Visual Studio 2012\Projects\PlayWithXceed\PlayWithXceed\XceedStream.cs:line 32

     

    Test code looks like this:

             public static void UnzipFileStream()
            {
                using (var sourceFileStream = new FileStream(@”d:\Temp\964b844d18b14237a2ba92a04ea93196.zip”, FileMode.Open, FileAccess.Read))
                {
                    using (var zipReader = new ZipReader(sourceFileStream))
                    {
                        ZipItemLocalHeader header = zipReader.ReadItemLocalHeader();
                        string path = Path.Combine(@”d:\Temp”, header.FileName.Replace(“\\”, “”));

                        if (File.Exists(path))
                        {
                            File.Delete(path);
                        }

                        using (var targetFileStream = new FileStream(path, FileMode.CreateNew, FileAccess.Write, FileShare.None))
                        {
                            zipReader.ReadItemData(targetFileStream);
                            zipReader.ReadEndHeader();                        
                        }
                    }
                }
            }

    Do you have any idea what’s going wrong?

     Test file available here : https://yadi.sk/d/bJ8WmyChnhHBH

     

    Thank you

    Sergii

    Imported from legacy forums. Posted by Sergii (had 1 views)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.