J:\jtest>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)
Steps to Reproduce :
Consider the following program:
import java.io.*;
public class IncSeq {
public static void main(String[] args){
try {
byte[] bb = new byte[] {(byte)0300};
ByteArrayInputStream inp = new ByteArrayInputStream(bb);
InputStreamReader ist = new InputStreamReader(inp,"UTF8");
ist.read();
} catch (Throwable t){
System.out.println(t);
}
}
}
when the program is run with java 1.2/3/3.1, it prints:
J:\jtest>java IncSeq
sun.io.MalformedInputException
when it is run with java 1.4 it prints nothing. I.e. it does not
recognize the a single byte 0300 (i.e. 0xc0) is an incomplete UTF8
sequence.
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)
Steps to Reproduce :
Consider the following program:
import java.io.*;
public class IncSeq {
public static void main(String[] args){
try {
byte[] bb = new byte[] {(byte)0300};
ByteArrayInputStream inp = new ByteArrayInputStream(bb);
InputStreamReader ist = new InputStreamReader(inp,"UTF8");
ist.read();
} catch (Throwable t){
System.out.println(t);
}
}
}
when the program is run with java 1.2/3/3.1, it prints:
J:\jtest>java IncSeq
sun.io.MalformedInputException
when it is run with java 1.4 it prints nothing. I.e. it does not
recognize the a single byte 0300 (i.e. 0xc0) is an incomplete UTF8
sequence.
- relates to
-
JDK-4407092 (cs) JCK: InputStreamReader.read behaves incorrectly
-
- Closed
-