-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
generic
-
generic
Name: mlR10151 Date: 04/19/2001
According to the spec, FileImageOutputStream.read():
"The bit offset within the stream is reset to zero before the read occurs. "
Spec. says nothing about restoring the bit offset after reading,
so the getBitOffset() method must return zero after reading,
but it returns non-zero value in the example below:
===================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.write(new byte[100]);
fios.seek(0);
fios.readBit();
fios.read();
System.out.println(fios.getBitOffset() == 0 ? "Passed" : "Failed" );
}
}
======================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
Failed
This bug causes failure of the following JCK test:
api/javax_imageio/stream/FileImageOutputStream/index.html#read
======================================================================