you may include in ur while :
int i = yourStream.indexOf("the text u detect");
if(i > 1) {
yourStream = yourStream.substring(i + yourStream.length());
System.out.println(yourStream);
}
i had ur same problem when i made my java app which extracts the word meaning from an online dictionary. hope it helps..
regards