Ejemplo n.º 1
0
        public LzxDecompression() {
            uint dataBlockMax = 0x8000;

            var config = new LzxNativeMethods.LZX_CONFIGURATION();
            config.CompressionWindowSize = 0x20000;
            config.SecondPartitionSize = 1;

            uint decompressBufferMin = 0;

            context = IntPtr.Zero;

            uint result = LzxNativeMethods.LDICreateDecompression(out dataBlockMax, &config, LzxNativeMethods.managed_mem_alloc, LzxNativeMethods.managed_mem_free, IntPtr.Zero, out decompressBufferMin, out context);
        }
Ejemplo n.º 2
0
        public LzxDecompression()
        {
            uint dataBlockMax = 0x8000;

            var config = new LzxNativeMethods.LZX_CONFIGURATION();

            config.CompressionWindowSize = 0x20000;
            config.SecondPartitionSize   = 1;

            uint decompressBufferMin = 0;

            context = IntPtr.Zero;

            uint result = LzxNativeMethods.LDICreateDecompression(out dataBlockMax, &config, LzxNativeMethods.managed_mem_alloc, LzxNativeMethods.managed_mem_free, IntPtr.Zero, out decompressBufferMin, out context);
        }
Ejemplo n.º 3
0
        public LzxCompression() {
            uint dataBlockMax = 0x8000;

            var config = new LzxNativeMethods.LZX_CONFIGURATION();
            config.CompressionWindowSize = 0x20000;
            config.SecondPartitionSize = 1;

            context = IntPtr.Zero;

            uint pcbDstBufferMin = 0;

            uint result = LzxNativeMethods.LCICreateCompression(out dataBlockMax, &config, LzxNativeMethods.managed_mem_alloc, LzxNativeMethods.managed_mem_free, out pcbDstBufferMin, out context, delegate (IntPtr fci_data, byte* pbCompressed, uint cbCompressed, uint cbUncompressed) {
                dst = new byte[cbCompressed];

                for (var i = 0; i < cbCompressed; i++) {
                    dst[i] = *pbCompressed;
                    pbCompressed++;
                }
            }, IntPtr.Zero);
        }
Ejemplo n.º 4
0
        public LzxCompression()
        {
            uint dataBlockMax = 0x8000;

            var config = new LzxNativeMethods.LZX_CONFIGURATION();

            config.CompressionWindowSize = 0x20000;
            config.SecondPartitionSize   = 1;

            context = IntPtr.Zero;

            uint pcbDstBufferMin = 0;

            uint result = LzxNativeMethods.LCICreateCompression(out dataBlockMax, &config, LzxNativeMethods.managed_mem_alloc, LzxNativeMethods.managed_mem_free, out pcbDstBufferMin, out context, delegate(IntPtr fci_data, byte *pbCompressed, uint cbCompressed, uint cbUncompressed) {
                dst = new byte[cbCompressed];

                for (var i = 0; i < cbCompressed; i++)
                {
                    dst[i] = *pbCompressed;
                    pbCompressed++;
                }
            }, IntPtr.Zero);
        }