Ejemplo n.º 1
0
        public List <BalloonLogEntry> Read(int logEntryStartIndex, int count)
        {
            var logEntryList       = new List <BalloonLogEntry>();
            var dummyLogEntryBytes = BalloonLogManager.GetLogEntryBytes(BalloonLogEntry.Type.DummyLogRecord, 0, 0);

            readLogStream.Seek(logEntryStartIndex * dummyLogEntryBytes.Length, SeekOrigin.Begin);
            var bytes         = new byte[count * dummyLogEntryBytes.Length];
            var readByteCount = readLogStream.Read(bytes, 0, bytes.Length);
            var offset        = 0;

            for (var i = 0; i < readByteCount / dummyLogEntryBytes.Length; i++)
            {
                logEntryList.Add(new BalloonLogEntry
                {
                    ticks = BitConverter.ToInt64(bytes, offset + 0),
                    type  = BitConverter.ToInt32(bytes, offset + 0 + 8),
                    arg1  = BitConverter.ToInt32(bytes, offset + 0 + 8 + 4),
                    arg2  = BitConverter.ToInt64(bytes, offset + 0 + 8 + 4 + 4)
                });
                offset += dummyLogEntryBytes.Length;
            }

            return(logEntryList);
        }
Ejemplo n.º 2
0
        public long Count()
        {
            var dummyLogEntryBytes = BalloonLogManager.GetLogEntryBytes(BalloonLogEntry.Type.DummyLogRecord, 0, 0);

            return(readLogStream.Length / dummyLogEntryBytes.Length);
        }