internal void mszipd_init(mspack_system system,
                                  int input_buffer_size,
                                  int repair_mode)
        {
            input_buffer_size = (input_buffer_size + 1) & -2;
            if (input_buffer_size == 0)
            {
                throw new Exception();
            }


            /* allocate input buffer */
            this.inbuf = new byte[input_buffer_size];

            /* initialise decompression state */
            this.sys          = system;
            this.inbuf_size   = (uint)input_buffer_size;
            this.error        = MspackError.OK;
            this.repair_mode  = repair_mode;
            this.flush_window = new FlushWindowDelegate(mszipd_flush_window);

            this.i_ptr      = this.i_end = 0;
            this.o_ptr      = this.o_end = -1;
            this.bit_buffer = 0; this.bits_left = 0;
        }
示例#2
0
        public CabDecompressor(CompressionType type)
        {
            // only create the compressor stuff if the target is compressed
            if (type == CompressionType.MSZIP)
            {
                m_zstm         = new MsZipStream();
                m_system       = new mspack_system();
                m_system.write = new WriteDelegate(Writer);
                m_system.read  = new ReadDelegate(Reader);
                m_zstm.mszipd_init(m_system, 4096, 0);
            }

            m_compressionType = type;
        }