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

spec: decription for the ImageInputStream.flushBefore(long) is incomplete

XMLWordPrintable

    • beta2
    • generic
    • generic



      Name: mlR10151 Date: 04/10/2001



      The spec for the ImageInputStreamImpl reads:

      "public void flushBefore(long pos) throws IOException

            Description copied from interface: ImageInputStream
            Discards the initial portion of the stream prior to the indicated postion. Attempting to seek to
            an offset within the flushed portion of the stream will result in an IndexOutOfBoundsException.

            Calling flushBefore may allow classes implementing this interface to free up resources such as
            memory or disk space that are being used to store data from the stream.

            Specified by:
                  flushBefore in interface ImageInputStream
            Following copied from interface: javax.imageio.stream.ImageInputStream
            Parameters:
                  pos - a long containing the length of the file prefix that may be flushed.
            Throws:
                  IOException - if an I/O error occurs."

      So, it's not clear, how the flushBefore(long pos) method must behave if pos is greater
      then the current position in the stream. Should it increase the current position in this case?
      Should it throw an exception?

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

            dricesunw Daniel Rice (Inactive)
            mlsunw Ml Ml (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: