Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Expected end of stream not found when using CompressionLevel.None with ZipWriter

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

    When ever I speicify CompressionLevel.None in the ZipItemLocalHeader and then try to read the output stream I am getting this error.

    Xceed.Compression.CompressionException: Expected end of stream not found

    at Xceed.Compression.ManagedDeflateDecompressor.Decompress(Byte[] buffer, Int32 offset, Int32 count, Boolean& endOfData, Byte[]& decompressed, Int32& remaining)
    at Xceed.Compression.CompressedStream.Read(Byte[] bufferInt32 offsetInt32 count)
    at Xceed.Utils.Streams.ChecksumStream.Read(Byte[] bufferInt32 offsetInt32 count)
    at Xceed.Zip.ReaderWriter.ZipReader.ReadItemData(Byte[] bufferInt32 offsetInt32 count)
    Was able to reproduce this issue using your RealTimeZipSample by just changing the compression level, we are using Xceed.Zip.v5.0, Version=5.0.10308.13200, Culture=neutral, PublicKeyToken=ba83ff368b7563c6

    Imported from legacy forums. Posted by Adam (had 2307 views)

    Diane [Xceed]
    Post count: 1353

    Hi Adam,

    The Xceed Real-Time Zip component does not seek in the zip stream. As such, ZipWriter uses the “data descriptor” feature of the zip format to write the compressed size value after an item’s data, as illustrated here:


    Since ZipReader doesn’t seek in the stream, when it reads an item from a zip archive created by ZipWriter, it doesn’t know the size of the compressed data since it is not written in the main header. ZipReader then relies on the decompression algorithm to detect when the end of data has been reached.

    This is obviously not possible when CompressionLevel.None has been used for an item. That is why this doesn’t work.


    Imported from legacy forums. Posted by Diane [Xceed] (had 1463 views)

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