Code example for CharsetEncoder

Methods: onMalformedInput, onUnmappableCharacter

0
            e.onUnmappableCharacter(CodingErrorAction.REPLACE);
            return e;
        } 
 
        e = charset.newEncoder();
        e.onMalformedInput(CodingErrorAction.REPLACE);
        e.onUnmappableCharacter(CodingErrorAction.REPLACE);
        map.put(charset, e);
        return e;
    } 
 
    /** 
     * Returns a cached thread-local {@link CharsetDecoder} for the specified 
     * <tt>charset</tt>. 
     */ 
    public static CharsetDecoder getDecoder(Charset charset) {
        if (charset == null) {
            throw new NullPointerException("charset");
        } 
 
        Map<Charset, CharsetDecoder> map = decoders.get();