Пример #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
        public AsyncDecoder(DecoderSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            mSyncObject   = new object();
            mDecodeAction = new Action(Decode);
            mDecoder      = new Decoder(settings);
        }
Пример #3
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();
        }
Пример #4
0
        public AsyncDecoder(DecoderSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            mSyncObject   = new object();
            mDecodeAction = new Action(Decode);
            mDecoder      = new Decoder(settings);
            mInputQueue   = new Queue <InputFrame>();
            mOutputQueue  = new Queue <OutputFrame>();
        }
Пример #5
0
        public AsyncDecoder(DecoderSettings settings)
        {
            if (settings == null)
                throw new ArgumentNullException(nameof(settings));

            mSyncObject = new object();
            mDecodeAction = new Action(Decode);
            mDecoder = new Decoder(settings);
        }