我想問下 為什么我在ioBuffer.putString(s, charsetEncoder);的時候 報錯了
The method putString(CharSequence, CharsetEncoder) from the type IoBuffer refers to the missing type CharSequence ?這是報錯的原因
String s = null;
if(message instanceof String){
s = (String)message;
}
if(s != null){
CharsetEncoder charsetEncoder = (CharsetEncoder)session.getAttribute("encoder");
if(charsetEncoder == null){
charsetEncoder = Charset.defaultCharset().newEncoder();
}
IoBuffer ioBuffer = IoBuffer.allocate(s.length());
ioBuffer.setAutoExpand(true);
ioBuffer.putString(s, charsetEncoder);
ioBuffer.flip();
out.write(ioBuffer);
}
這是我的代碼
2017-06-30
應(yīng)該是sdk 版本問題