Ravi Sankar Pabbati wrote:
>
> I had the same problem with Strings in serialization. I think the limit is
> around 60000 characters in a string that is to be serialized.
A String is serialized using the DataOutputStream class. This class converts the
String to its UTF representation. It also counts the number of bytes needed for
the UTF representation, and if that number is greater than 65535 (jdk1.1.7,
probably 1.2 and 1.3 as well, but I don't have the source to check those), then
it throws a UTFDataFormatException.
So the limit is not 60000 chars, or even 64K chars, its the number of chars that
fit into 64K bytes. If all your chars fall in the range of 0x0000 to 0c007F
(basically the first 128 chars in the ASCII set) then you can indeed get 64K
chars. If all your chars are in the range of 0x0800 to 0xffff, then each char
requires three UTF bytes, and you will be limited to a bit more than 21K chars.
If you have a mix of chars, you'll get something in between 21K and 64K chars.
K Mukhar
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html