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

FileImageOutputStream.writeBits(long,int) throws unexpected IOE

XMLWordPrintable



      Name: mlR10151 Date: 04/19/2001



      Method writeBits(long,int) of the FileImageOutputStream class throws unexpected IOException.
      To reproduce the bug run the following test:

      ========================== a.java =============================
      import java.io.*;
      import javax.imageio.stream.*;

      public class a {
          public static void main (String argv[]) throws Exception {
              System.setSecurityManager(null);
              File tempFile = File.createTempFile("test", "tmp");
              FileImageOutputStream fios = new FileImageOutputStream(tempFile);
              fios.writeBits(0xFFFFFFFFFFFFFFFFL, 1);
              System.out.println("Passed");
          }
      }
      ==========================log========================
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b60)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b60, mixed mode)
      % java a
      Exception in thread "main" java.io.IOException: Negative seek offset
              at java.io.RandomAccessFile.seek(Native Method)
              at javax.imageio.stream.FileImageOutputStream.seek(FileImageOutputStream.java:107)
              at javax.imageio.stream.ImageOutputStreamImpl.writeBits(ImageOutputStreamImpl.java:403)
              at a.main(a.java:9)


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


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

            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: