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

Peter Jones peter.jones at sun.com
Fri Jan 4 16:04:25 UTC 2008


If your concern is primarily about Java object serialization, note
that it has supported serializing strings with UTF-8 encoding larger
than 64KB since J2SE 1.3:

        http://bugs.sun.com/view_bug.do?bug_id=4217676

I presume that 4128333 remains open for Data{Input,Output}Stream only.

-- Peter


On Wed, Jan 02, 2008 at 07:25:02PM -0800, cowwoc wrote:
> 
> Hi,
> 
> Bug URL: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4128333
> 
> 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!
> Gili



More information about the core-libs-dev mailing list