public static byte[] GetMpqFile(MpqArchive archive, string fileName) { using (var mpqStream = archive.OpenFile(archive.Single(i => i.Filename == fileName))) { var buffer = new byte[mpqStream.Length]; mpqStream.Read(buffer, 0, buffer.Length); return(buffer); } }
private static byte[] GetMpqArchiveFileBytes(MpqArchive archive, string fileName) { using (var mpqStream = archive.OpenFile(archive.Single(i => i.Filename == fileName))) { var buffer = new byte[mpqStream.Length]; mpqStream.Read(buffer, 0, buffer.Length); return buffer; } }