예제 #1
0
파일: SbpFile.cs 프로젝트: engrin/GzsTool
        public override void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.ASCII, true);
            uint magic = reader.ReadUInt32();
            byte fileCount = reader.ReadByte();
            ushort headerSize = reader.ReadUInt16();
            byte padding = reader.ReadByte();

            List<SbpEntry> entries = new List<SbpEntry>();
            string entityName = Path.GetFileNameWithoutExtension(Name);
            for (int i = 0; i < fileCount; i++)
            {
                var entry = new SbpEntry();
                entry.FileName = entityName;
                entry.Read(reader);
                entries.Add(entry);
            }
            input.AlignRead(16);
            Entries = entries;
        }
예제 #2
0
        public override void Read(Stream input)
        {
            BinaryReader reader     = new BinaryReader(input, Encoding.ASCII, true);
            uint         magic      = reader.ReadUInt32();
            byte         fileCount  = reader.ReadByte();
            ushort       headerSize = reader.ReadUInt16();
            byte         padding    = reader.ReadByte();

            List <SbpEntry> entries    = new List <SbpEntry>();
            string          entityName = Path.GetFileNameWithoutExtension(Name);

            for (int i = 0; i < fileCount; i++)
            {
                var entry = new SbpEntry();
                entry.FileName = entityName;
                entry.Read(reader);
                entries.Add(entry);
            }
            input.AlignRead(16);
            Entries = entries;
        }