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(); } }
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(); } }