/// <summary> /// Construct a decoder with the given settings. The amount of memory required depends on the settings. /// </summary> /// <param name="settings">The settings for the decoder must match the settings used when the data was encoded.</param> public Decoder(DecoderSettings settings) { mSettings = settings; mDecoder = new LZMA.Master.LZMA.CLzma2Dec(); mDecoder.Lzma2Dec_Construct(); if (mDecoder.Lzma2Dec_Allocate(settings.GetInternalData(), LZMA.Master.LZMA.ISzAlloc.SmallAlloc) != LZMA.Master.LZMA.SZ_OK) throw new InvalidOperationException(); mDecoder.Lzma2Dec_Init(); }
/// <summary> /// Construct a decoder with the given settings. The amount of memory required depends on the settings. /// </summary> /// <param name="settings">The settings for the decoder must match the settings used when the data was encoded.</param> public Decoder(DecoderSettings settings) { mSettings = settings; mDecoder = new LZMA.Master.LZMA.CLzma2Dec(); mDecoder.Lzma2Dec_Construct(); if (mDecoder.Lzma2Dec_Allocate(settings.GetInternalData(), LZMA.Master.LZMA.ISzAlloc.SmallAlloc) != LZMA.Master.LZMA.SZ_OK) { throw new InvalidOperationException(); } mDecoder.Lzma2Dec_Init(); }