An alternate way...just iterate over the read lines until the end of file is reached (eg null is returned from readLine())


String line = null;
while ( ( line = dis.readLine()) != null ){
if...