Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
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)