Name: el35337 Date: 01/17/97
consider the following java program:
import java.io.*;
public class StreamTokenizerCat {
public static void main(String [] argv) throws IOException {
StreamTokenizer t = new StreamTokenizer(System.in);
while (t.nextToken() != StreamTokenizer.TT_EOF)
System.out.println(t);
}
}
under solaris 2.4 jdk 1.1 beta2, this works fine.
under windows 95 jdk 1.1 beta2, i get the following traceback:
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.BufferedReader.fill(BufferedReader.java:141)
at java.io.BufferedReader.read(BufferedReader.java:158)
at java.io.StreamTokenizer.nextToken(StreamTokenizer.java:287)
at StreamTokenizerCat.main(StreamTokenizerCat.java:6)
i believe you can reproduce this bug by simply calling the available method
of System.in as the first thing in main()
======================================================================
- duplicates
-
JDK-4023791 InputStreamReader does not work on the Win32 console input stream
-
- Closed
-