标签:col str obj substring for sse buffer mat lan
java.io.UTFDataFormatException: encoded string too long: 259553 bytes
按如下修改可避开此问题。
- output.writeUTF(jsonObject.toString()); + String jsos = jsonObject.toString(); + int bufferSize = 60000; + int i =0; + int sum = 0; + + while(i < jsos.length()){ + int endIdx = java.lang.Math.min(jsos.length(),i+bufferSize); + String jsosPart = jsos.substring(i,endIdx); + output.writeUTF(jsosPart); + sum += jsosPart.length(); + i += bufferSize; + } + assert sum == jsos.length(); +// output.writeUTF(jsonObject.toString());
java.io.UTFDataFormatException: encoded string too long:
标签:col str obj substring for sse buffer mat lan
原文地址:https://www.cnblogs.com/suanec/p/9857353.html