public void ReadBinary(ESPReader reader) { Tag = reader.ReadTag(); Size = reader.ReadUInt32(); Flags = (RecordFlag)reader.ReadUInt32(); FormID = reader.Read <FormID>(); LastModified = new DateStamp(); LastModified.ReadBinary(reader); reader.ReadBytes(2); FormVersion = reader.ReadUInt16(); reader.ReadBytes(2); if (Flags.HasFlag(RecordFlag.Compressed)) { byte[] outBytes; compressionCorrupted = !TryDecompressData(reader, out outBytes); if (compressionCorrupted) { corruptedBytes = outBytes; } else { using (MemoryStream stream = new MemoryStream(outBytes)) using (ESPReader subReader = new ESPReader(stream, reader.Plugin)) ReadData(subReader, stream.Length); } } else { ReadData(reader, reader.BaseStream.Position + Size); } }
public RecordView(ESPReader reader, MemoryMappedFile file) { master = reader.Plugin; Source = DataSource.Binary; this.file = file; Offset = reader.BaseStream.Position; Tag = reader.ReadTag(); Size = reader.ReadUInt32() + 24; Flags = (RecordFlag)reader.ReadUInt32(); FormID = reader.Read <FormID>(); VersionControlInfo1 = reader.ReadUInt32(); FormVersion = reader.ReadUInt16(); VersionControlInfo2 = reader.ReadUInt16(); reader.BaseStream.Seek(Offset + Size, SeekOrigin.Begin); }
public virtual void ReadBinary(ESPReader reader) { Tag = reader.ReadTag(); size = reader.ReadUInt16(); long endPosition = reader.BaseStream.Position + size; ReadData(reader); if (reader.BaseStream.Position != endPosition) { reader.BaseStream.Seek(endPosition, SeekOrigin.Begin); } }