public void Load(ITableReader reader) { Debug.Assert(reader != null); foreach (byte b in Signature) { if (reader.ReadByte() != b) { throw new CorruptedStreamException(); } } DataPosition = reader.ReadLong(); TableVersion = reader.ReadUInt(); DateTime creation = reader.ReadTime(); DateTime access = reader.ReadTime(); DateTime write = reader.ReadTime(); uint nextId = reader.ReadUInt(); DoLoad(reader); LastWriteTime = write; LastAccessTime = access; CreationTime = creation; m_nextId = nextId; IsDirty = false; }
public void Load(ITableReader reader) { Assert(reader != null); byte[] sign = Signature; byte[] bytes = reader.ReadBytes(sign.Length); for (int i = 0; i < sign.Length; ++i) { if (sign[i] != bytes[i]) { throw new CorruptedStreamException(); } } uint ver = reader.ReadUInt(); uint tag = reader.ReadUInt(); int nTotal = reader.ReadInt(); int ndxDeleted = reader.ReadInt(); int sz = reader.ReadInt(); if (nTotal <= ndxDeleted || sz <= 0) { throw new CorruptedStreamException(); } CreationTime = reader.ReadTime(); LastWriteTime = reader.ReadTime(); Version = ver; Tag = tag; FrameCount = nTotal; FirstDeletedFrameIndex = ndxDeleted; FrameSize = sz; DataOffset = reader.Position; IsDirty = false; }