コード例 #1
0
ファイル: GzsEntry.cs プロジェクト: JosephZoeller/GzsTool
        public static GzsEntry ReadGzsEntry(Stream input)
        {
            GzsEntry gzsEntry = new GzsEntry();

            gzsEntry.Read(input);
            return(gzsEntry);
        }
コード例 #2
0
ファイル: GzsFile.cs プロジェクト: JosephZoeller/GzsTool
        public override void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.Default, true);

            input.Seek(-4, SeekOrigin.End);
            int footerSize = reader.ReadInt32();

            input.Seek(-20, SeekOrigin.Current);
            if (footerSize != 20)
            {
                throw new Exception("Invalid gzs footer.");
            }
            GzsArchiveFooter footer = GzsArchiveFooter.ReadGzArchiveFooter(input);

            input.Seek(16 * footer.EntryBlockOffset, SeekOrigin.Begin);
            for (int i = 0; i < footer.ArchiveEntryCount; i++)
            {
                Entries.Add(GzsEntry.ReadGzsEntry(input));
            }
        }