Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all articles
Browse latest Browse all 239

New Post: Sample for LzmaStream

$
0
0
Hi,

I try to create LzmaStream compressor by using this:
            ms.WriteByte(9);
            ms.WriteByte(20);
            ms.WriteByte(5);
            ms.WriteByte(0);

            LzmaStream lzmaStream = new LzmaStream(new LzmaEncoderProperties(!ms.CanSeek, 10000), false, ms);
            ms.Write(lzmaStream.Properties, 0, lzmaStream.Properties.Length);
            return lzmaStream;
and decompressor by this:
            var reader = new BinaryReader(ms);
            reader.ReadUInt16(); //LZMA version
            var props = new byte[reader.ReadUInt16()];
            reader.Read(props, 0, props.Length);
            return new LzmaStream(props, ms, ms.Length - 4 - props.Length, -1); 
both ms is MemoryStream for the input source.

During decompress, I get DataErrorException in
SharpCompress.Compressor.LZMA.Decoder

Do you have sample for LzmaStream?

Thanks.

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>