private void parseQueryInfo(boolean last) {
        int openBracketPos = findNextChar(responseContent, '{');
        int closeBracketPos = findSectionClosingPosition(responseContent, '{', '}');
        if (closeBracketPos == -1) {
            if (last) {
                throw new IllegalStateException("Could not find metrics closing in last chunk");
            } else {
                return; //wait for more data
            }
        }

        int from = responseContent.readerIndex() + openBracketPos;
        int to = closeBracketPos - openBracketPos - responseContent.readerIndex() + 1;
        queryInfoObservable.onNext(responseContent.slice(from, to).copy());
        responseContent.readerIndex(to + openBracketPos);

        //has to be here rather than in parseQueryResponse, as when there is a split
        //(and thus not enough data) it could finish the metrics too early
        finishInfo();
    }
private void parseQueryInfo ( boolean last ) { int openBracketPos = findNextChar ( responseContent , '{' ) ; int closeBracketPos = findSectionClosingPosition ( responseContent , '{' , '}' ) ; if ( closeBracketPos == - 1 ) { if ( last ) { throw new IllegalStateException ( "Could not find metrics closing in last chunk" ) ; } else { return ; } } int from = responseContent . readerIndex ( ) + openBracketPos ; int to = closeBracketPos - openBracketPos - responseContent . readerIndex ( ) + 1 ; queryInfoObservable . onNext ( responseContent . slice ( from , to ) . copy ( ) ) ; responseContent . readerIndex ( to + openBracketPos ) ; finishInfo ( ) ; }
At the end of the response stream, parse out the info portion (metrics).

For the sake of easiness, since we know it comes at the end, we wait until the full data is together and read
the info json objects off in one shot (but they are still emitted separately).

@param last if this batch is the last one.