-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.1
-
x86
-
linux
Name: krC82822 Date: 03/06/2001
java version "1.3.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-beta-b15)
Java HotSpot(TM) Client VM (build 1.3.1beta-b15, mixed mode)
1.------
Use
method void readFully(short[],int,int)
of
class javax.imageio.stream.FileImageInputStream
or
class javax.imageio.stream.MemoryCacheImageInputStream
reading 2 bytes > 0x7F
2.------
import java.io.*;
import javax.imageio.stream.*;
public class ImageIoReadShortTest extends Object {
public static void main (String args[]) {
try {
byte[] b = {
(byte)0x01, (byte)0x23,
(byte)0x45, (byte)0x67,
(byte)0x89, (byte)0xAB,
(byte)0xCD, (byte)0xEF };
InputStream in = new ByteArrayInputStream(b);
ImageInputStream iin = new MemoryCacheImageInputStream(in);
iin.setByteOrder(true);
short[] s = new short[b.length/2];
iin.readFully(s,0,s.length);
for (int i = 0; i < s.length; ++i) {
System.out.println(Integer.toHexString(s[i]));
}
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}
> java -cp .:../lib/imageio.jar ImageIoReadShortTest
123
4567
ffffffab { should be 89ab }
ffffffef { should be cdef }
(Review ID: 118073)
======================================================================
- duplicates
-
JDK-4422263 ImageInputStreamImpl.readFully(short[],int,int) fails
-
- Resolved
-