01: package kawa.standard;
02:
03: public class char_ready_p {
04: public static boolean ready(Object arg1) {
05: try {
06: if (arg1 instanceof java.io.InputStream)
07: return ((java.io.InputStream) arg1).available() > 0;
08: else if (arg1 instanceof java.io.Reader)
09: return ((java.io.Reader) arg1).ready();
10: else
11: throw new ClassCastException(
12: "invalid argument to char-ready?");
13: } catch (java.io.IOException ex) {
14: return false;
15: }
16: }
17: }
|