private void maybePushConfigChunk ( ) { String currentChunk = responseContent . toString ( CHARSET ) ; int separatorIndex = currentChunk . indexOf ( "\n\n\n\n" ) ; if ( separatorIndex > 0 ) { String content = currentChunk . substring ( 0 , separatorIndex ) ; streamingConfigObservable . onNext ( content . trim ( ) ) ; responseContent . clear ( ) ; responseContent . writeBytes ( currentChunk . substring ( separatorIndex + 4 ) . getBytes ( CHARSET ) ) ; } }
Push a config chunk into the streaming observable .