private void parseViewInfo ( ) { int rowsStart = - 1 ; for ( int i = responseContent . readerIndex ( ) ; i < responseContent . writerIndex ( ) - 2 ; i ++ ) { byte curr = responseContent . getByte ( i ) ; byte f1 = responseContent . getByte ( i + 1 ) ; byte f2 = responseContent . getByte ( i + 2 ) ; if ( curr == ' ' && f1 == ' ' && f2 == ' ' ) { rowsStart = i ; break ; } } if ( rowsStart == - 1 ) { return ; } ByteBuf info = responseContent . readBytes ( rowsStart - responseContent . readerIndex ( ) ) ; int closingPointer = info . forEachByteDesc ( new ByteBufProcessor ( ) { @ Override public boolean process ( byte value ) throws Exception { return value != ' ' ; } } ) ; if ( closingPointer > 0 ) { info . setByte ( closingPointer , ' ' ) ; viewInfoObservable . onNext ( info ) ; } else { //JVMCBC-360 don't forget to release the now unused info ByteBuf info . release ( ) ; viewInfoObservable . onNext ( Unpooled . EMPTY_BUFFER ) ; } viewInfoObservable . onCompleted ( ) ; viewParsingState = QUERY_STATE_ROWS ; }
Parse out the info portion from the header part of the query response .