Why doesn't CharBuffer.put(String) take a CharSequence?

Gili cowwoc at bbs.darktech.org
Thu Jun 25 12:54:59 PDT 2009


Any chance you can roll this in as part of JDK7? :)

Right now my code has to use fragile "instanceof" code. It will break if new
implementations are added in the future. I took a look at the underlying
methods for put(CharBuffer) and put(String) and they seem to be doing the
exact same thing, just using get() instead of chatAt().

Gili


Alan Bateman wrote:
> 
> Gili wrote:
>> Hi,
>>
>> I'm curious, why does
>> http://java.sun.com/javase/6/docs/api/java/nio/CharBuffer.html#put(java.lang.String)
>> take a String instead of a CharSequence?
>>
>> Thank you,
>> Gili
>>   
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4860681
> 
> 

-- 
View this message in context: http://n2.nabble.com/Why-doesn%27t-CharBuffer.put%28String%29-take-a-CharSequence--tp3155780p3157343.html
Sent from the nio-discuss mailing list archive at Nabble.com.




More information about the nio-discuss mailing list