Update buffer readerIndex after XML parsing error
The readerIndex of the input buffer may have not reached the end
of the message when XML parsing fails. And in this case unnecessary
decoding may get repeatedly triggered for the unread partial message.
Make sure that readerIndex advances to writerIndex so that the next
decoding can start for a new message and add a test case to show this
parsing error scenario.
It means that we can skip all readable bytes counted by:
(ByteBuff.writerIndex - ByteBuff.readerIndex).
JIRA: NETCONF-1194
Change-Id: I01b668eb0c995ff01435e983cdbba1490645909e
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>