예제 #1
0
        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);
        }
예제 #2
0
파일: Buffer.cs 프로젝트: slluis/heap-shot
 Buffer(BinaryReader reader)
 {
     Header = BufferHeader.Read (reader);
     var endPos = reader.BaseStream.Position + Header.Length;
     while (reader.BaseStream.Position < endPos) {
         Events.Add (Event.Read (reader));
     }
 }
예제 #3
0
 Buffer(LogFileReader reader)
 {
     Header = BufferHeader.Read (reader);
     var endPos = reader.Position + Header.Length;
     while (reader.Position < endPos) {
         Events.Add (Event.Read (reader));
     }
 }
예제 #4
0
		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.");
		}
예제 #5
0
        Buffer(BinaryReader reader)
        {
            Header = BufferHeader.Read(reader);
            var endPos = reader.BaseStream.Position + Header.Length;

            while (reader.BaseStream.Position < endPos)
            {
                Events.Add(Event.Read(reader));
            }
        }
예제 #6
0
        Buffer(LogFileReader reader)
        {
            Header = BufferHeader.Read(reader);
            var endPos = reader.Position + Header.Length;

            while (reader.Position < endPos)
            {
                Events.Add(Event.Read(reader));
            }
        }
예제 #7
0
        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;
        }