Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6408

[classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0M12
    • Classlib
    • None
    • Patch Available

    Description

      Following is the exception trace:
      java.nio.BufferOverflowException

      java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
      at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
      at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
      at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
      at java.io.Writer.write(Writer.java:98)
      at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
      at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
      Caused by: java.nio.BufferOverflowException
      at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
      at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
      at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
      at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)

      In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312.
      If I set the encoder to "ISO8859_1" the test passed.
      So I think most of the members from China will got this error.

      Attachments

        1. Harmony-6408.diff
          2 kB
          Ray Chen

        Activity

          People

            regis_xu Regis Xu
            chleicdl Ray Chen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: