K
Kaidi
Anyone has any idea?
The reason is: when I try to use the writeUTF of ObjectOutputStream to
write out a String, I get the error of UTFDataFormatException
exception.
I traced it to the ObjectOutputStream class, and found the lines where
the exeception happens look like:
void writeUTF(String s, long utflen) throws IOException
{
if (utflen > 0xFFFFL) {
throw new UTFDataFormatException();
}
......
....
}
So it only allows the String to be at max 0xFFFFL? Why has such a
restriction?
PS: actually I am not writing out a too large String, it is only a
String which is the content of a 90K plain text file!
Thanks.
The reason is: when I try to use the writeUTF of ObjectOutputStream to
write out a String, I get the error of UTFDataFormatException
exception.
I traced it to the ObjectOutputStream class, and found the lines where
the exeception happens look like:
void writeUTF(String s, long utflen) throws IOException
{
if (utflen > 0xFFFFL) {
throw new UTFDataFormatException();
}
......
....
}
So it only allows the String to be at max 0xFFFFL? Why has such a
restriction?
PS: actually I am not writing out a too large String, it is only a
String which is the content of a 90K plain text file!
Thanks.