Casting InputStreamReader as (char)
===

I'm presently working my way through *Java: The Complete Reference 8th Edition* by Herbert Schildt. I'm a recent compsci grad and a novice programmer.

In the I/O chapter, the book presents a small piece of sample code (I've included it below). The code creates a BufferedReader that is supplied with InputStreamReader(System.in) as an argument (line 6). I checked the [Java SE7 docs for InputStreamReader](http://docs.oracle.com/javase/7/docs/api/java/io/InputStreamReader.html) and it says that it "[...]reads bytes and decodes them into characters[...]". My question is, why is it necessary (or is it even necessary) to cast br.read() as a char when assigning it to 'c' in line 9 of the example code?

Thank you very much for any assistance.

Jamie

    1.  import java.io.*
    2.  
    3.  class BRRead {
    4.       public static void main(String args[]) throws IOException {
    5.            char c;
    6.            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    7.            System.out.println("Enter characters, 'q' to quit.");
    8.            do {
    9.                 c = (char) br.read();
    10.                System.out.println(c);
    11.           } while(c != 'q');
    12.      }
    13. }