DESCRIPTION

JVMCBC-85: Prevent too far lokahead on view info parsing.

Motivation
----------
When the view "info" part is parsed that comes before the
actual rows, the code looks ahead to see if it already
finds the beginning of the streaming rows.

If the chunk that is returned is that large that the rows
have not started yet (which can be the case when debug()
is enabled), the lookahead goes to far, leading to an
IndexOutOfBoundsException.

Modifications
-------------
The code now checks if the lookahead is actually possible based
on the index provided and if not just keeps fetching data. This
prevents the exception and allows for larger info chunks.

Result
------
No IndexOutOfBoundsException on larger info chunks, including
when debug() is enabled.

Change-Id: If1850649c8f7643810c9224edc79ac563ef4d7e1
Reviewed-on: http://review.couchbase.org/44418
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-12-29 10:49:41.497000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2014-12-29 10:49:59.958000000

Patch Set 1: Verified+1

-------------------------------------
author: Estrella Humphrey
date: 2014-12-29 10:57:54.256000000

Patch Set 1: Code-Review+2

-------------------------------------
