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

FileInputStream.available() does not throw IOException for closed stream (win32)

XMLWordPrintable

    • 1.2beta4
    • x86, sparc
    • solaris_2.5.1, windows_95
    • Not verified



      Name: mgC56079 Date: 04/16/98



      ---- Here is the test ----
      import java.io.FileInputStream;
      import java.io.IOException;

      public class FIS {

        public static void main(String args[]) {
          try {
            FileInputStream fis = new FileInputStream("FIS.java");
            fis.close();
            System.out.println(fis.available());
          }
          catch (IOException e) {
            e.printStackTrace();
          }
        }

      }
      ---- Output on Solaris (correct) ----
      % java FIS
      java.io.IOException
      at java.io.FileInputStream.available(Native Method)
      at FIS.main(FIS.java:10)
      ---- Output on Win95 (wrong) ----
      I:\bugs>java -Djava.compiler=NONE FIS
      Warning: JIT compiler "NONE" not found. Will use interpreter.
      7733632
      ----

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

            zlisunw Zhenghua Li (Inactive)
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: