text: public static byte[] readData(InputStream stream, String section ) throws IOException {try {StringBuilder sectionText = new StringBuilder();boolean inSection = false;int c = stream.read();while ( c != -1 ) {switch ( c ) {case '[':inSection = true;break;case '\n':case '\r':inSection = false;sectionText = new StringBuilder();break;case ']':inSection = false;if ( sectionText.toString().equals( section ) ) return readData( stream, '[' );sectionText = new StringBuilder();break;default:if ( inSection ) sectionText.append( (char) c );}c = stream.read();}} finally {stream.close();}throw new IOException( "Section '" + section + "' not found" );}