-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
generic
-
generic
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
======================================================================
- duplicates
-
JDK-4434216 MemoryCacheImageOutputStream.writeBit() does not update the length
- Resolved