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

(spec) InputStream.mark - Behavior on closed stream not specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 1.2.0
    • core-libs
    • b89
    • generic
    • generic

      Date: Tue, 13 Oct 1998 12:44:35 -0600
      From: Roger Hoover <###@###.###>
      To: guy.steele@East
      Subject: InputStream semantics

      While running the VolanoMark server benchmark under
      our class libraries we have observed behavior that
      we thought was illegal, but seems to be accepted by
      jdk1.2beta4. We would like a definitive answer as
      to whether or not the following is acceptable.

      The code in question causes the following sequence
      of operations to take place:
      java.io.FilterInputStream.mark(), this=java.io.DataInputStream@727cbec5,
      this.in=java.io.BufferedInputStream@721cbec5, [Thread[Receiver-181,5,main]]

      java.io.FilterInputStream.close(), this=java.io.DataInputStream@727cbec5,
      this.in=java.io.BufferedInputStream@721cbec5, [Thread[Receiver-181,5,main]]

      java.io.FilterInputStream.mark(), this=java.io.DataInputStream@727cbec5,
      this.in=java.io.BufferedInputStream@721cbec5, [Thread[Receiver-181,5,main]]

      java.io.FilterInputStream.close(), this=java.io.DataInputStream@727cbec5,
      this.in=java.io.BufferedInputStream@721cbec5, [Thread[Sender-181,5,main]]

      Note that these four operations are on the same InputStream, with
      a mark() and close() following the first close() operation.

      According to _The_Java_Language_Specification_, p. 682,
      "A closed stream cannot perform input operations and
      cannot be reopened." Our runtime enforces this for the
      InputStream operation mark().

      Looking at the jdk1.2beta4/docs/api/java/io/InputStream.html#close(),
      I see that the above prohibition is not mentioned. Can
      you come up with a specification of exactly which calls are
      valid after a stream is closed?

            jhangalsunw Jayalaxmi Hangal (Inactive)
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: