using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) using (BinaryReader br = new BinaryReader(fs)) { newFile = br.ReadBytes((int)fs.Length); crc = CRC32Bytes(newFile); fileSizeUncompressed = (UInt32)newFile.Length; } to newFile = File.ReadAllBytes(filename); crc = CRC32Bytes(newFile); fileSizeUncompressed = (UInt32)newFile.Length;