https://issues.apache.org/bugzilla/show_bug.cgi?id=52579

--- Comment #6 from Konstantin Kolinko <knst.koli...@gmail.com> 2012-02-04 
01:29:57 UTC ---
(In reply to comment #5)
> Maybe we can 
> implement (...) just use a simple ThreadLocal
> to pass a Decoder instance around while processing the same request.

If a Decoder instance is obtained from a ThreadLocal a quick way to test it
against required charset is to compare it with decoder.charset().


3) For large input data the current implementation that calls Charset.decode()
is better than the proposed one, because it allocates less memory. The
difference is between (size * averageCharsPerByte()) and (size *
maxCharsPerByte()).

I think threshold can be around 10 bytes.

The Java bug #6196991 occurs when the value of (input size *
decoder.averageCharsPerByte()) coerced to integer is 0.  In this case in Java 5
the CharsetDecoder#decode(ByteBuffer) method erroneously treats it as if no
input data were available. If input is > 10 bytes it should not trigger the bug
#6196991.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to