示例#1
0
        public GOBStream(string path)
        {
            _stream = new FileStream(path, FileMode.Open);
            var br = new BinaryReader(_stream);

            br.ReadChars(3);
            Version = br.ReadByte();
            br.ReadInt32();
            br.ReadInt32();
            var numItems = br.ReadInt32();

            Records = new GOBRecord[numItems];
            for (int i = 0; i < numItems; i++)
            {
                Records[i] = new GOBRecord
                {
                    Offset = br.ReadInt32(),
                    Length = br.ReadInt32(),
                    Name   = ReadChars(br, 128)
                };
            }
        }
示例#2
0
 public Stream GetRecordStream(GOBRecord record)
 {
     _stream.Position = record.Offset;
     return(new PartStream(_stream, record.Length));
 }