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

flushBefore(long) does not throw IndexOutOfBoundsException

    XMLWordPrintable

Details

    • beta2
    • generic
    • generic

    Description



      Name: mlR10151 Date: 03/29/2001



      The description for the FileCacheImageOutputStream.flushBefore(long pos)
      says:

      . . .
      Throws:
                  IndexOutOfBoundsException - if pos lies in the flushed portion of the stream.
      . . .

      But it goes without any exception:
      ===================== a.java =======================
      import java.io.*;
      import javax.imageio.stream.FileCacheImageOutputStream;

      public class a {
          public static void main (String argv[]) throws Exception {
              OutputStream ostream = new ByteArrayOutputStream();
              FileCacheImageOutputStream fcios = new FileCacheImageOutputStream(ostream, null);
              try {
                  fcios.write(new byte[10], 0, 10);
                  fcios.flushBefore(5);
                  fcios.flushBefore(4);
                  System.out.println("Failed");
              } catch (IndexOutOfBoundsException e) {
                  System.out.println("Passed");
              }
          }
      }
      ===================== log =======================
      java version "1.4.0-internal"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-internal-b57)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b57, mixed mode)
      Failed

      This bug causes failure of the new JCK test
      api/javax_imageio/stream/FileCacheImageOutputStream/index.html#flush

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: