Skip to main content

Please review fix for Issue 86 - UPDATED

1 reply [Last post]
bkurotsu
Offline
Joined: 2004-12-13
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
andreytitov
Offline
Joined: 2009-03-13
Points: 0

Fix looks good for me. But there is one thing - as I understand this code will produce overflowed output in some cases - when the last write(...) invocation will overflow output.

String s = output.toString();
                        output = new StringBuffer(s.substring(0, overflowStart));
                        output.append(OVERFLOW_MESSAGE);
                        output.append(s.substring(overflowEnd));

s.substring(0, overflowStart) is 1/3 of the maxOutputSize, s.substring(overflowEnd) is 2/3 of maxOutputSize and there is also OVERFLOW_MESSAGE that also has some length.