-
Enhancement
-
Resolution: Duplicate
-
P5
-
None
-
1.1, 1.1.7
-
generic, x86
-
solaris_2.5, windows_98
There needs to be a class in java.io that can take ASCII/Unicode input from
the keyboard for all the primitive types.
Currently the only built-in support is for binary data. That is almost
never what is wanted for terminal I/O.
The class should be called something like PrintInputStream and it would
read character date and assemble it into values of the primitive types.
Currently, programmers are obliged to do this by hand, forming the worst
possible impression on those new to the language. Even Pascal has better
support than this. Even C has better support than this. Even C++ has better
support than this.
This is how we must currently read an integer from System.in
import java.util.*;
static DataInputStream dis = new DataInputStream( System.in );
static StringTokenizer st;
try {
st=new StringTokenizer(dis.readLine());
int myint = Integer.parseInt(st.nextToken());
We have to offer something a bit better!
peter.vanderlinden@Eng 1996-09-15
the keyboard for all the primitive types.
Currently the only built-in support is for binary data. That is almost
never what is wanted for terminal I/O.
The class should be called something like PrintInputStream and it would
read character date and assemble it into values of the primitive types.
Currently, programmers are obliged to do this by hand, forming the worst
possible impression on those new to the language. Even Pascal has better
support than this. Even C has better support than this. Even C++ has better
support than this.
This is how we must currently read an integer from System.in
import java.util.*;
static DataInputStream dis = new DataInputStream( System.in );
static StringTokenizer st;
try {
st=new StringTokenizer(dis.readLine());
int myint = Integer.parseInt(st.nextToken());
We have to offer something a bit better!
peter.vanderlinden@Eng 1996-09-15
- duplicates
-
JDK-4313885 Scanning and formatting [scanning]
- Resolved
- relates to
-
JDK-4235914 EOFException in readUnsignedByte when stream is of a certain size
- Closed
-
JDK-4050435 Improved interactive console I/O (password prompting, line editing)
- Resolved