Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4025513

BufferedReader constructed on System.in fails to read

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_95

      Description



      Name: el35337 Date: 01/13/97

      If I create a BufferedReader on the System.in (STDIN) stream
      and attempt to read, I get an IO Exception. Here's some sample code
      <snip>
            BufferedReader input = new BufferedReader
               (new InputStreamReader(System.in));
            String str=input.readLine();
            System.out.println("String is: " + str);
      <snip>
      When executed, this produces the following exception stack:
      <snip>
      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.readLine(BufferedReader.java:213)
              at intest.main(intest.java:9)
      <snip>
      Adobe Systems, Inc. ###@###.###

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr Mark Reinhold
              Reporter:
              elarsen Erik Larsen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: