Other |
---|
1.1 1.1beta3Fixed |
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
This bug was originally reported by Steven Buroff <###@###.###>, who noticed that LineNumberReader throws an IOException when used on the Win32 console input stream. Here is a simplified example, which shows that the problem really is that available() isn't supported by the console input stream. import java.io.*; public class ISRAvailable { public static void main(String[] args) { InputStreamReader isr = new InputStreamReader(System.in); int c; try { c = isr.read(); } catch(IOException excp) { excp.printStackTrace(); } } } Under Win32: F:\bugs\io>p:\w\jdk\build\win32\bin\java ISRAvailable java.io.IOException at java.io.BufferedInputStream.available(BufferedInputStream.java:181) at java.io.InputStreamReader.fill(InputStreamReader.java:216) at java.io.InputStreamReader.read(InputStreamReader.java:273) at java.io.InputStreamReader.read(InputStreamReader.java:249) at ISRAvailable.main(ISRAvailable.java:33) F:\bugs\io>
|