1
Vote

On-the-Fly decompression

description

On-the-Fly decompression not working :(
 
sample 1:
 
using (FileStream fs = new FileStream(filePath, FileMode.Open))
{
using (LzmaDecodeStream szs = new LzmaDecodeStream(fs))
{
     using (XmlTextReader reader = new XmlTextReader(szs)) <--- Exception here
     {
            [...]
 
 
Sample 2:
 
using (FileStream fs = new FileStream(filePath, FileMode.Open))
{
using (LzmaDecodeStream szs = new LzmaDecodeStream(fs))
{
     int test = szs.Read(new byte[4096], 0, 100); <--- Exception here
            [...]
 
 
 
StackTrace:
at System.IO.MemoryStream.SetLength(Int64 value)
 

 
Seams to occurs in the "ReadChunk" methode in the "LzmaDecodeStream" class.
  1. long size; <---- init with 0
  2. properties = SevenZipExtractor.GetLzmaProperties(_input, out size); <--- seam to get false size
  3. _buffer.SetLength(size); <---- as result fails
     
    a 15kb size *.7z file with contend is a 500kb size xml file, generates a size of 8975296948835909660 in the GetLzmaProperties Methode.
    There went somethink wrong.

comments