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

CharToByteJIS enters into infinite loop

XMLWordPrintable

    • 1.1fcs
    • generic, x86
    • generic, windows_95
    • Not verified

      The following example program causes the infinite loop in side the system.
      Program never comes back after it prints " " on system console.

      public class JISCode {
        public static void main(String args[0]) {
          try {
            OutputStreamWriter osw = new OutputStreamWriter(System.out, "JIS");
            osw.write(" ");
            osw.flush();
            osw.close();
          } catch (Exception e) {
            e.printStackTrace();
          }
        }
      }

      Using ByteArrayOutputStream instead causes OutOfMemoryError.

            nishimur Naoyuki Ishimura (Inactive)
            sishidasunw Shoji Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: