public static BufferHeader Read(LogFileReader reader) { BufferHeader result; long position = reader.Position; if (!reader.LoadData(48)) { return(null); } try { result = new BufferHeader(reader); } catch { Console.WriteLine("Exception reading buffer at position {0}", position); throw; } if (!reader.LoadData(result.Length)) { reader.Position = position; // rollback return(null); } return(result); }
public static Header Read(LogFileReader reader) { if (!reader.LoadData(30)) { return(null); } return(new Header(reader)); }