code: public boolean canEncode(CharSequence cs) {
          CharBuffer cb;
          if (cs instanceof CharBuffer)
              cb = ((CharBuffer)cs).duplicate();
          else
              cb = CharBuffer.wrap(cs);
          return canEncode(cb);
      }
docs: Tells whether or not this encoder can encode the given character
  sequence.
  
  <p> If this method returns <tt>false</tt> for a particular character
  sequence then more information about why the sequence cannot be encoded
  may be obtained by performing a full <a href="#steps">encoding
  operation</a>.
  
  <p> This method may modify this encoder's state; it should therefore not
  be invoked if an encoding operation is already in progress.
  
  <p> The default implementation of this method is not very efficient; it
  should generally be overridden to improve performance.  </p>
  
  @return  <tt>true</tt> if, and only if, this encoder can encode
  the given character without throwing any exceptions and without
  performing any replacements
  
  @throws  IllegalStateException
  If an encoding operation is already in progress