JDK-4128333 : Data{Input,Output}Stream UTF strings restricted to 65536 encoded bytes
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.1.5,1.1.6,1.2.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic,solaris_2.6,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-04-13
  • Updated: 2008-01-04
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Object Serialization uses DataOutput.writeUTF to write String objects.
However, the specification currently limits the length of the
encoded string to 65535 bytes.  Since the encoding is data dependent
that actual allowable length is (conservately) limited to ~21845.

Is is reasonable to devise a revision to the specification to encode
larger strings up to some specified limit?

EVALUATION ###@###.### notes that Serialization has supported serializing strings with UTF-8 encoding larger than 64KB since jdk1.3 as a result of the fix applied by 4217676. This RFE exists to provide support for Data{Input,Output}Stream only.


EVALUATION I don't see how we can change the encoding specified in the Data{Input,Output} interfaces without breaking compatibility with prior JDK releases, even for programs that just use the Data{Input,Output}Stream classes and never use serialization. It seems to me that the bug here is that serialization uses this encoding in the first place. -- mr@eng 4/16/1998