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

(spec) DataInputStream.read() spec is misleading

XMLWordPrintable

    • b63
    • sparc
    • solaris_2.6

      Name: asR10047 Date: 06/19/2002


      Specification of DataInputStream class seems to be copied from
      FilterInputStream so the spec for DataInputStream constructor says:
          Creates a FilterInputStream ...

      and contains unfinished sentence : "An internal"


      Further. The spec for DataInputStream.read() methods says:
          In particular, an IOException is thrown if
          the input stream has been closed.

      that is not always true. IOException will be thrown only if
      the input stream throws IOException on attempt to read when
      it is previously closed. But if the DataInputStream object
      has ByteArrayInputStream as it's input stream no IOException
      will be thrown regardless was ByteArrayInputStream closed or not.

      So I propose to change that sentence on something like
          In particular, an IOException is thrown if
          the input stream has been closed and
          the input stream does not support reading after close.

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

            jhangalsunw Jayalaxmi Hangal (Inactive)
            anssunw Ans Ans (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: