Ask for review: java.io.Ouputs
Alan Bateman
Alan.Bateman at Sun.COM
Sat Nov 22 09:47:11 PST 2008
Xueming Shen wrote:
> Alan Bateman wrote:
>>
>>>
>>> (2)Is it really necessary to check "Charset.isSupproted()"? The csn
>>> will be checked when the
>>> Charset is created later anyway, why do lookup twice. Yes,
>>> understood it can catch the problem
>>> 1-2 step(s) earlier, I double you want to pay that price.
>> All parameters need to be checked before the file is created (or
>> truncated).
>
> Did not consider that:-) an alternative is to get the encoder first
> then the file creation.
Yes, that is the right thing to do and this also ensures that the
encoder has the default action to report errors.
-Alan.
More information about the nio-dev
mailing list