2. if(readByte == -1 || readByte == '\r')
break;
3. fileName += (char) readByte;
}
// Reads the file and prints it to the System.out stream.
4. char[] buffer = new char[20];
5. FileReader reader = new
FileReader(fileName);
while(true) {
6. int length = reader.read(buffer);
if(length < 0) // Reads a long as there is more data.
break;
7. String text = new String(buffer, 0, length);
System.out.print(text);
}
} catch (IOException e) {
e.printStackTrace();