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

Tried to read standard in. IOException: null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1 P1
    • None
    • 1.1
    • core-libs
    • None
    • x86
    • windows_nt



      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 + "'");
          }

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

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: