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); }
Buffer(BinaryReader reader) { Header = BufferHeader.Read (reader); var endPos = reader.BaseStream.Position + Header.Length; while (reader.BaseStream.Position < endPos) { Events.Add (Event.Read (reader)); } }
Buffer(LogFileReader reader) { Header = BufferHeader.Read (reader); var endPos = reader.Position + Header.Length; while (reader.Position < endPos) { Events.Add (Event.Read (reader)); } }
Buffer (BinaryReader reader) { Header = BufferHeader.Read (reader); var endPos = reader.BaseStream.Position + Header.Length; while (reader.BaseStream.Position < endPos) { Events.Add (Event.Read (reader)); } System.Console.WriteLine ("Buffer loaded."); }
Buffer(BinaryReader reader) { Header = BufferHeader.Read(reader); var endPos = reader.BaseStream.Position + Header.Length; while (reader.BaseStream.Position < endPos) { Events.Add(Event.Read(reader)); } }
Buffer(LogFileReader reader) { Header = BufferHeader.Read(reader); var endPos = reader.Position + Header.Length; while (reader.Position < endPos) { Events.Add(Event.Read(reader)); } }
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; }