Example #1
0
 public void Resume(byte[] data, int size)
 {
     Start = 0;
     ReadSize = size;
     data.CopyTo(ReadBuffer, 0);
     ReadStatus = G2ReadResult.PACKET_INCOMPLETE;
 }
Example #2
0
        private bool ReadNext(G2Header root)
        {
            if (ReadSize > 0)
            {
                int prevStart = Start;

                ReadStatus = G2Protocol.ReadNextPacket(root, ref Start, ref ReadSize);

                ParentPos += (Start - prevStart);

                if (ReadStatus == G2ReadResult.PACKET_GOOD)
                    return true;
            }

            // hit the exact end of the buffer read in, signal to read the next buffer in
            else
                ReadStatus = G2ReadResult.PACKET_INCOMPLETE;

            return false;
        }
Example #3
0
        public byte[] Break()
        {
            byte[] remaining = Utilities.ExtractBytes(ReadBuffer, Start, ReadSize);

            ReadSize = 0;
            ReadStatus = G2ReadResult.PACKET_INCOMPLETE;

            return remaining;
        }