reading a char

I need a method in the java API that reads a char, and returns a char, to be used with BufferedReader.All I can find is a read() that returns the char as an int!Thanks.
[189 byte] By [Shorinhioa] at [2007-11-26 20:30:12]
# 1

That's on purpose. The int is -1 if you are at end-of-file. Otherwise, it can be cast to a char:

int input = in.read();

if (input == -1) {

//react to end-of-file

} else {

char ch = (char) input;

...

}

DrLaszloJamfa at 2007-7-10 1:19:46 > top of Java-index,Java Essentials,New To Java...
# 2
thankyou!
Shorinhioa at 2007-7-10 1:19:46 > top of Java-index,Java Essentials,New To Java...