Example #1
0
        public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream presetDictionary, Stream outputStream)
        {
            this.outWindow         = new OutWindow();
            this.rangeDecoder      = new SharpCompress.Compressor.LZMA.RangeCoder.Decoder();
            this.position          = 0L;
            this.endReached        = false;
            this.inputPosition     = 0L;
            this.uncompressedChunk = false;
            this.needDictReset     = true;
            this.needProps         = true;
            this.props             = new byte[5];
            this.isLZMA2           = isLZMA2;
            this.availableBytes    = 0L;
            this.endReached        = true;
            if (isLZMA2)
            {
                throw new NotImplementedException();
            }
            this.encoder = new SharpCompress.Compressor.LZMA.Encoder();
            this.encoder.SetCoderProperties(properties.propIDs, properties.properties);
            MemoryStream outStream = new MemoryStream(5);

            this.encoder.WriteCoderProperties(outStream);
            this.props = outStream.ToArray();
            this.encoder.SetStreams(null, outputStream, -1L, -1L);
            if (presetDictionary != null)
            {
                this.encoder.Train(presetDictionary);
            }
        }
Example #2
0
 public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream presetDictionary, Stream outputStream)
 {
     this.outWindow = new OutWindow();
     this.rangeDecoder = new SharpCompress.Compressor.LZMA.RangeCoder.Decoder();
     this.position = 0L;
     this.endReached = false;
     this.inputPosition = 0L;
     this.uncompressedChunk = false;
     this.needDictReset = true;
     this.needProps = true;
     this.props = new byte[5];
     this.isLZMA2 = isLZMA2;
     this.availableBytes = 0L;
     this.endReached = true;
     if (isLZMA2)
     {
         throw new NotImplementedException();
     }
     this.encoder = new SharpCompress.Compressor.LZMA.Encoder();
     this.encoder.SetCoderProperties(properties.propIDs, properties.properties);
     MemoryStream outStream = new MemoryStream(5);
     this.encoder.WriteCoderProperties(outStream);
     this.props = outStream.ToArray();
     this.encoder.SetStreams(null, outputStream, -1L, -1L);
     if (presetDictionary != null)
     {
         this.encoder.Train(presetDictionary);
     }
 }
Example #3
0
        public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream presetDictionary, Stream outputStream)
        {
            this.isLZMA2   = isLZMA2;
            availableBytes = 0;
            endReached     = true;

            if (isLZMA2)
            {
                throw new NotImplementedException();
            }

            encoder = new Encoder();
            encoder.SetCoderProperties(properties.propIDs, properties.properties);
            MemoryStream propStream = new MemoryStream(5);

            encoder.WriteCoderProperties(propStream);
            props = propStream.ToArray();

            encoder.SetStreams(null, outputStream, -1, -1);
            if (presetDictionary != null)
            {
                encoder.Train(presetDictionary);
            }
        }
Example #4
0
 public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream outputStream)
     : this(properties, isLZMA2, null, outputStream)
 {
 }
Example #5
0
        public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream presetDictionary, Stream outputStream)
        {
            this.isLZMA2 = isLZMA2;
            availableBytes = 0;
            endReached = true;

            if (isLZMA2)
                throw new NotImplementedException();

            encoder = new Encoder();
            encoder.SetCoderProperties(properties.propIDs, properties.properties);
            MemoryStream propStream = new MemoryStream(5);
            encoder.WriteCoderProperties(propStream);
            props = propStream.ToArray();

            encoder.SetStreams(null, outputStream, -1, -1);
            if (presetDictionary != null)
                encoder.Train(presetDictionary);
        }
Example #6
0
 public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream outputStream)
     : this(properties, isLZMA2, null, outputStream)
 {
 }