CharBuffer cb; if (cs instanceof CharBuffer) cb = ((CharBuffer) cs).duplicate (); else cb = CharBuffer.wrap (cs);
CharBuffer cb = CharBuffer.allocate (1).put (c); cb.flip ();
  public boolean canEncode (CharSequence cs)  {    CharBuffer cb;    if (cs instanceof CharBuffer)      cb = ((CharBuffer) cs).duplicate ();    else      cb = CharBuffer.wrap (cs);    return canEncode (cb);  }