Huge output causes UTFDataFormatException

ShinyaYoshida bitterfoxc at gmail.com
Sun Apr 19 16:18:59 UTC 2015


Hi,
I met UTFDataFormatException with a huge output:

-> java.util.stream.Stream.generate(() -> "
").limit(65534).collect(java.util.stream.Collectors.joining())
Exception in thread "main" java.io.UTFDataFormatException
at
java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2169)
at
java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2012)
at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:869)
at remote.RemoteAgent.commandLoop(RemoteAgent.java:106)
at remote.RemoteAgent.main(RemoteAgent.java:54)
|  State engine terminated.  See /history
|  Resetting...

The cause is rejecting the String which is over 65536 UTF-length in
OOW#writeUTF.
I think we should use OOW#writeObject.

Here is my patch & test, please review my patch:
http://cr.openjdk.java.net/~shinyafox/kulla/201504201/webrev.00/

Regards,
shinyafox(Shinya Yoshida)


More information about the kulla-dev mailing list