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

InputStream.read() contains undocumented behaviour when interrupted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.2.1
    • core-libs
    • generic
    • generic

      Name: vi73552 Date: 06/29/99


      - The documentation of the method read-methods of
        java.io.InputStream dos not explain what happens,
        if a thread is blocked in read and another thread
        send interrupt() to the blocked thread.

      - Unter Linux/JDK 1.1.6 and Win95/1.2 read ends with
        -1 as result. Bad: The -1 stands for EOF. But an
        interrupt isn't EOF!!!!

      - Unter Solaris/JDK1.2.1 the read is interrupted with
        an IOException with message "Interrupted systen call".
        Bad: A interrupt isn't a I/O-Error!!!

      I thing this is the correct solution: InterruptedException
      should extend RuntimeExeption, so read can throw these
      Exception. interrupt to an blocked read should throw
      InterruptedException.

      At least you should define a uniq behaviour in the
      documentation.

      Write once, run everwhere....
      (Review ID: 84964)
      ======================================================================

            Unassigned Unassigned
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: