private void OnBody(byte b)
 {
     remainingBodyLength--;
     if (remainingBodyLength == 0)
     {
         nextAction = OnLrc;
     }
 }
        private void OnLrc(byte lrc)
        {
            if (lrc != currentLrc)
            {
                throw new InvalidOperationException("LRC byte expected!");
            }

            IsComplete = !hasMoreMessages;
            nextAction = OnNad;
        }
 private void OnLen(byte length)
 {
     remainingBodyLength = length;
     if (remainingBodyLength == 0)
     {
         nextAction = OnLrc;
     }
     else
     {
         nextAction = OnBody;
     }
 }
 private void OnPcb(byte pcb)
 {
     hasMoreMessages = (pcb & 0x01) == 0x01;
     nextAction      = OnLen;
 }
 private void OnNad(byte nad)
 {
     nextAction = OnPcb;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EmvMemoryStream"/> class.
 /// </summary>
 public EmvMemoryStream()
 {
     nextAction = OnNad;
 }