[jdk1.4.0, Linux]
Reading from file with UTF-16LE or UTF-16BE by InputStreamReader
causes endless loop at java.io.FileInputStream.available(Native Method).
It's reproducible on jdk1.4.0 including 1.4.0_01-b03 with file greater
than 50k, see test.zip attached. On jdk1.3.1 and jdk1.4.1-b13 in works fine.
Code sample:
------------
...
isr = new InputStreamReader(Main.class.getResourceAsStream("test_be.xml"),"UTF-16BE");
isr.read(cbuf, 0, cbuf.length);
System.out.println(String.valueOf(cbuf));
...
Reading from file with UTF-16LE or UTF-16BE by InputStreamReader
causes endless loop at java.io.FileInputStream.available(Native Method).
It's reproducible on jdk1.4.0 including 1.4.0_01-b03 with file greater
than 50k, see test.zip attached. On jdk1.3.1 and jdk1.4.1-b13 in works fine.
Code sample:
------------
...
isr = new InputStreamReader(Main.class.getResourceAsStream("test_be.xml"),"UTF-16BE");
isr.read(cbuf, 0, cbuf.length);
System.out.println(String.valueOf(cbuf));
...
- duplicates
-
JDK-4657074 InputStreamReader loops forever when decoding more than 8192 bytes in UTF-16
-
- Resolved
-