Пример #1
0
        /// <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 Master.LZMA.CLzmaDec();
            mDecoder.LzmaDec_Construct();
            if (mDecoder.LzmaDec_Allocate(settings.ToArray(), Master.LZMA.LZMA_PROPS_SIZE, Master.LZMA.ISzAlloc.SmallAlloc) != Master.LZMA.SZ_OK)
                throw new InvalidOperationException();
            mDecoder.LzmaDec_Init();
        }
Пример #2
0
        /// <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 Master.LZMA.CLzmaDec();
            mDecoder.LzmaDec_Construct();
            if (mDecoder.LzmaDec_Allocate(settings.ToArray(), Master.LZMA.LZMA_PROPS_SIZE, Master.LZMA.ISzAlloc.SmallAlloc) != Master.LZMA.SZ_OK)
            {
                throw new InvalidOperationException();
            }
            mDecoder.LzmaDec_Init();
        }