Am 29.04.2011 02:11, schrieb Xueming Shen:
On 04-28-2011 3:46 PM, Ulf Zibis wrote:

It's safe to say that java.nio.cs.StandardCharset is not for 
String.getBytes()/toCharArray()
only, so the fact that "cs" variant of String.getBytes()/toCharArray() is "slower" than 
its "csn"
variant arguably might not be a very strong/supportive material for that 
discussion:-)
So what prevents us from the same caching optimization in ZipCoder etc. class ?


What do you want to cache in ZipCoder? Each ZipFile object holds one ZipCoder 
object and
uses it for its coding need through its lifetime. And ZipCoder does "remember" 
its de/encoder.
I see! Yes, caching it for consecutive ZipFiles would be too much overhead compared to the "heavy" other work of each ZipFile.

Thanks for the discussion,

-Ulf

Reply via email to