Code example for CharsetDecoder

Methods: onMalformedInputonUnmappableCharacter

0
    private CharsetDecoder getDecoder() {
 
        if (decoder == null) {
            Charset cs = Charsets.lookupCharset(encoding);
            decoder = cs.newDecoder();
            decoder.onMalformedInput(CodingErrorAction.REPLACE);
            decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
        } 
 
        return decoder;
 
    } 
     
    /** 
     * @param size the amount of data that must be available for a {@link ReadHandler} 
     *  to be notified. 
     * @param available the amount of data currently available. 
     * 
     * @return <code>true</code> if the handler should be notified during a call 
     *  to {@link #notifyAvailable(ReadHandler)} or {@link #notifyAvailable(ReadHandler, int)}, 
Contextual code suggestions in your IDE  Get Codota for Java