public final ByteBuffer encode(CharBuffer buffer) {try {return newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE).encode(buffer);} catch (CharacterCodingException ex) {throw new Error(ex.getMessage(), ex);}}
public java.nio.ByteBuffer encode(java.nio.CharBuffer buffer){try{return newEncoder().onMalformedInput(java.nio.charset.CodingErrorAction.REPLACE).onUnmappableCharacter(java.nio.charset.CodingErrorAction.REPLACE).encode(buffer);}catch (java.nio.charset.CharacterCodingException ex){throw new System.Exception(ex.Message, ex);}}