Example #1
0
        public void Decompress(T[] data)
        {
            Contract.Requires(!IsUncompressed);
            Contract.Requires(data != null);
            Contract.Requires(data.Length == Bounds.Width * Bounds.Height * Bounds.Depth);

            Uncompressed = data;
            Compressed.CopyTo(Uncompressed);
        }
Example #2
0
        private byte[] Compress(byte[] Input)
        {
            byte[] Compressed;
            Algo.CompressData(Input, out Compressed);
            CatHeader Header = new CatHeader()
            {
                Singnature       = "CatScene",
                CompressedSize   = (uint)Compressed.LongLength,
                DecompressedSize = (uint)Input.LongLength
            };

            byte[] Output = new byte[0x10 + Header.CompressedSize];
            Tools.BuildStruct(ref Header, false, Encoding).CopyTo(Output, 0);
            Compressed.CopyTo(Output, 0x10);

            Input      = new byte[0];
            Compressed = new byte[0];

            return(Output);
        }