All of Java's I/O facilities are based on streams that represent flowing sequences of characters or bytes. Java's I/O streams provide standardized ways to read and write data. Any object representing ...
It's not terribly clean, but you could use indexOf() and check if it returns -1. Better than breaking out a loop.