public static String readUntilTag ( Reader r ) throws IOException { if ( ! r . ready ( ) ) { return "" ; } StringBuilder b = new StringBuilder ( ) ; int c = r . read ( ) ; while ( c >= 0 && c != ' ' ) { b . append ( ( char ) c ) ; c = r . read ( ) ; } return b . toString ( ) ; }
Reads all text up to next XML tag and returns it as a String .