JDK-1238815 : writeUTF on a very long string will write incorrect length
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_1
  • CPU: sparc
  • Submitted: 1996-02-16
  • Updated: 1997-02-06
  • Resolved: 1997-02-06
Related Reports
Duplicate :  
Relates :  
Description
Shall we regard it as a bug that if you give a string to writeUTF
and its UTF length turns out to be > 65535, the writeUTF blithely
writes UTF data with an incorrect length (truncated to 16 bits)?

The easiest fix is that if the UTF length turns out to be > 65535,
then writeuTF should throw a UTFDataFormatException?

Comments
WORK AROUND If the String argument to writeUTF is less than 21844 characters long, then the bug cannot occur.
11-06-2004

PUBLIC COMMENTS writeUTF on a very long string will write incorrect length
10-06-2004