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

Tried to read standard in. IOException: null

    XMLWordPrintable

    Details

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

      Description



      Name: el35337 Date: 01/03/97



      /*
      This program generates:

      IOException: null
      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 example.main(example.java:11)

      JDK1.1 on NT
      */
      /**
       * @author Jeffrey Kutcher
       */
      import java.io.*;

      class example {

          public static void main(String[] args) {
             InputStreamReader isr = new InputStreamReader(System.in);
             BufferedReader br = new BufferedReader(isr);
             String s;
             try {
                 s = br.readLine();
             } catch(IOException e) {
                 System.err.println("IOException: " + e.getMessage());
                 e.printStackTrace();
                 return;
             }
             System.out.println("s='" + s + "'");
          }

      } ###@###.###

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

        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: