Exemple #1
0
 public void AddReportBlock(ReportBlock reportBlock)
 {
     if (reportBlocks == null)
     {
         reportBlocks = new List <ReportBlock>();
     }
     reportBlock.WriteToBuffer(Buffer, Offset + ReportBlocksStartPosition + reportBlocks.Count * ReportBlock.SIZE);
     reportBlocks.Add(reportBlock);
 }
Exemple #2
0
        protected override void LoadFromBuffer(byte[] buffer, int offset)
        {
            Buffer = buffer;
            Offset = offset;
            int position = ReportBlocksStartPosition;

            if (PacketLength > position)
            {
                reportBlocks = new List <ReportBlock>();
                while (PacketLength >= position + ReportBlock.SIZE)
                {
                    var reportBlock = new ReportBlock();
                    reportBlock.ReadFromBuffer(buffer, position);
                    reportBlocks.Add(reportBlock);
                    position += ReportBlock.SIZE;
                }
            }
        }