Menu

Can't decompress stream

Help
Greag.Deay
2014-06-16
2014-06-17
  • Greag.Deay

    Greag.Deay - 2014-06-16
    MemoryStream strm = new MemoryStream();
    Console.WriteLine("Compress " + bundleBody.Length);
    Helper.Compress(bundleBody, strm);
    MemoryStream uncStrm = new MemoryStream();
    Helper.Decompress(strm, uncStrm); // EXCEPTION
    Console.WriteLine("Decompressfghed " + uncStrm.Length);
    

    DataErrorException
    at LzmaDecoder.cs at 244

    I guess my data is wrong may be, I tried to compress and decompress an array from example and it works nice, so I tried to compress\decompress first 11 bytes of my data and it crashed!
    but if I send first less than 11 bytes it works nice!
    here is my array of data:

    -       _buffer {byte[12]}
    
    index | value | type
    ----- | ----- | -----
    [0]   | 0     | byte
    [1]   | 0     | byte
    [2]   | 0     | byte
    [3]   | 22    | byte
    [4]   | 122   | byte
    [5]   | 108   | byte
    [6]   | 105   | byte
    [7]   | 98    | byte
    [8]   | 46    | byte
    [9]   | 110   | byte
    [10]  | 101   | byte
    [11]  | 116   | byte
    
                _capacity   12  int
    

    why so? all i changed is dictionary size ( to 1 << 19 ), because that is a standard of unity.

     

    Last edit: Greag.Deay 2014-06-16
  • Greag.Deay

    Greag.Deay - 2014-06-17

    Okay, I did plan B:
    executing lzma.exe from cmd
    and it worked nice.

    but this exception still unknown to me.

     

Log in to post a comment.