/// <summary> /// /// </summary> /// <param name="properties"></param> /// <param name="isLZMA2"></param> /// <param name="presetDictionary"></param> /// <param name="outputStream"></param> public LzmaStream(LzmaEncoderProperties properties, bool isLZMA2, Stream presetDictionary, Stream outputStream) { Properties = new byte[5]; 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); Properties = propStream.ToArray(); encoder.SetStreams(null, outputStream, -1, -1); if (presetDictionary != null) { encoder.Train(presetDictionary); } }
public LzmaStream(LzmaEncoderProperties properties, bool isLzma2, Stream presetDictionary, Stream outputStream) { _isLzma2 = isLzma2; _availableBytes = 0; _endReached = true; if (isLzma2) { throw new NotImplementedException(); } _encoder = new Encoder(); _encoder.SetCoderProperties(properties._propIDs, properties._properties); byte[] prop = new byte[5]; _encoder.WriteCoderProperties(prop); Properties = prop; _encoder.SetStreams(null, outputStream, -1, -1); if (presetDictionary != null) { _encoder.Train(presetDictionary); } }
public LzmaStream(LzmaEncoderProperties properties, bool isLzma2, Stream outputStream) : this(properties, isLzma2, null, outputStream) { }