Пример #1
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);
            }
        }
Пример #2
0
 public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream outputStream)
     : this(properties, isLZMA2, null, outputStream)
 {
 }