Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4701794

Endless loop at java.io.FileInputStream.available(Native Method)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.4.0_01
    • core-libs
    • None
    • x86
    • linux

      [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));
      ...

            mr Mark Reinhold
            mschovan Martin Schovánek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: