Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4004086
Votes 2
Synopsis java.io: Add support for simple input parsing
Category java:classes_io
Reported Against 1.1 , 1.1.7
Release Fixed
State 11-Closed, duplicate of 4313885, request for enhancement
Priority: 5-Very Low
Related Bugs 4235914 , 4313885 , 4050435
Submit Date 16-SEP-1996
Description
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!

  xxxxx@xxxxx   1996-09-15
Work Around
N/A
Evaluation
To be addressed in the New I/O work.
--   xxxxx@xxxxx   2000/3/9
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang