Fixing bug #4128333: Serializing strings restricted to 64k bytes

cowwoc cowwoc at
Thu Jan 3 03:25:02 UTC 2008


Bug URL:

I'd like to start a discussion on how we can possibly solve this bug in a
backwards-compatible way. Here is my personal proposal but I'd love to hear
your own ideas!

1) Add a new method to DataInputStream/DataOutputStream for
encoding/decoding longer Strings (ideally this new encoding should have no
fixed limit). I think this should be done independently of Serialization as
this is needed by other clients.

2) Add a method to ObjectOutputStream to enable the new encoding format
(which is not backwards compatible). The default would be to use the old
encoding format but developers of new applications would be encouraged to
use the new format. I recommend ObjectOutputStream.setMinimumVersion(enum).
The default would be ObjectOutputStream.setMinimumVersion(JDK1_1) which
indicates the format is backwards-compatible to JDK 1.1 but we would add
ObjectOutputStream.setMinimumVersion(JDK1_7) for the new file format.

Please let me know what you think!
View this message in context:
Sent from the OpenJDK Core Libraries mailing list archive at

More information about the core-libs-dev mailing list