Example #1
0
        internal bool Update(FileBitReader r, out int csize, out int npos, out byte[] bytes)
        {
            bytes = null;
            csize = 0; npos = 0;
            while (csize <= npos)
            {
                if (r.IsEmpty())
                {
                    return(false);
                }

                int       spos = r.GetPos();
                CTFRecord cr   = tracePacketHeader.Read(r);
                CTFRecord pc   = packetContext.Read(r);
                int       epos = r.GetPos();
                npos  = epos - spos;
                csize = (int)(ulong)pc.GetValue("content_size");
                int    psize = (int)(ulong)pc.GetValue("packet_size");
                object o     = pc.GetValue("events_discarded");
                if (o is uint)
                {
                    EvsLost = (ulong)(uint)o;
                }
                else
                {
                    EvsLost = (ulong)o;
                }

                TSs    = (ulong)pc.GetValue("timestamp_begin");
                TSe    = (ulong)pc.GetValue("timestamp_end");
                psize /= 8;
                bytes  = new byte[psize];
                r.Read(bytes, npos, psize - npos);
                csize /= 8;
            }

            return(true);
        }
Example #2
0
 public MemoryBitReader(FileBitReader r, CTFPacketReader packetReader)
 {
     this.r            = r;
     this.packetReader = packetReader;
     Update();
 }