public static PTH Load(string path) { FileInfo fi = new FileInfo(path); Logger.LogToFile(Logger.LogLevel.Info, "{0}", path); PTH pth = new PTH(); using (var br = new BinaryReader(new FileStream(path, FileMode.Open))) { while (br.BaseStream.Position < br.BaseStream.Length) { pth.contents.Add(new PTHEntry { Name = br.ReadNullTerminatedString(), Size = (int)br.ReadUInt32(), Offset = (int)br.ReadUInt32() }); } } return pth; }
public static PTH Load(string path) { FileInfo fi = new FileInfo(path); Logger.LogToFile(Logger.LogLevel.Info, "{0}", path); PTH pth = new PTH(); using (BinaryReader br = new BinaryReader(new FileStream(path, FileMode.Open))) { while (br.BaseStream.Position < br.BaseStream.Length) { pth.contents.Add(new PTHEntry { Name = br.ReadNullTerminatedString(), Size = (int)br.ReadUInt32(), Offset = (int)br.ReadUInt32() }); } } return(pth); }