Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6447 [classlib] [imageio] Implement missing functionality in imageio module
  3. HARMONY-6611

ImageOutputStreamImplTest.testWriteUTF() unit test fails with ByteOrder.LITTLE_ENDIAN

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None
    • Patch Available

    Description

      When byte order is set to ByteOrder.LITTLE_ENDIAN, writeUTF() and readUTF() fails.

      I found the root cause is that we should ignore the current byte order setting in the writeUTF() and readUTF() methods, and use network byte order (which is ByteOrder.BIG_ENDIAN) instead .

      Please refer to the spec:
      1. readUTF() - http://download.oracle.com/javase/1.4.2/docs/api/javax/imageio/stream/ImageInputStreamImpl.html#readUTF()
      2. writeUTF() - http://download.oracle.com/javase/1.4.2/docs/api/javax/imageio/stream/ImageOutputStreamImpl.html#writeUTF(java.lang.String)

      Attachments

        1. HARMONY-6611.diff
          3 kB
          Lang Yang

        Activity

          People

            hindessm Mark Hindess
            yanglang Lang Yang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: