public String readUntil ( final char ... aEndChars ) { final StringBuilder aSB = new StringBuilder ( ) ; int nPos = m_nPos ; while ( nPos < m_sValue . length ( ) ) { final char ch = m_sValue . charAt ( nPos ) ; if ( ch == ' ' && nPos + 1 < m_sValue . length ( ) ) { final char c = m_sValue . charAt ( nPos + 1 ) ; if ( MarkdownHelper . isEscapeChar ( c ) ) { aSB . append ( c ) ; nPos ++ ; } else aSB . append ( ch ) ; } else { boolean bEndReached = false ; for ( final char cElement : aEndChars ) if ( ch == cElement ) { bEndReached = true ; break ; } if ( bEndReached ) break ; aSB . append ( ch ) ; } nPos ++ ; } final char ch = nPos < m_sValue . length ( ) ? m_sValue . charAt ( nPos ) : ' ' ; for ( final char cElement : aEndChars ) if ( ch == cElement ) { m_nPos = nPos ; return aSB . toString ( ) ; } return null ; }
Reads chars from this line until any end char is reached .