コード例 #1
0
ファイル: ddrPTH.cs プロジェクト: DevilboxGames/ToxicRagers
        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;
        }
コード例 #2
0
ファイル: ddrPTH.cs プロジェクト: q4a/ToxicRagers
        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);
        }