Пример #1
0
        public MyCompressionFileLoad(byte[] compressedVoxelContents)
        {
            using (MemoryStream fs = new MemoryStream(compressedVoxelContents))
            {
                using (BinaryReader br = new BinaryReader(fs))
                {
                    //  Read whole file to byte array and then decompress
                    m_decompressed = MyCompression.Decompress(br.ReadBytes((int)fs.Length));

                    //  Reset reading index
                    m_readIndex = 0;
                }
                fs.Close();
            }
        }
Пример #2
0
        public MyCompressionFileLoad(string fileName)
        {
            using (FileStream fs = File.OpenRead(fileName))
            {
                using (BinaryReader br = new BinaryReader(fs))
                {
                    //  Read whole file to byte array and then decompress
                    m_decompressed = MyCompression.Decompress(br.ReadBytes((int)fs.Length));

                    //  Reset reading index
                    m_readIndex = 0;
                }
                fs.Close();
            }
        }