Code example for CharsetDecoder

Methods: decode

0
 
 
    private boolean writeBuffer(final ByteBuffer buffer, final IoCallback callback) {
        StringBuilder builder = new StringBuilder();
        try { 
            builder.append(charsetDecoder.decode(buffer));
        } catch (CharacterCodingException e) {
            callback.onException(exchange, this, e);
            return false; 
        } 
        String data = builder.toString();
        writer.write(data);
        if (writer.checkError()) {
            callback.onException(exchange, this, new IOException());
            return false; 
        } 
        return true; 
    } 
 
 
Contextual code suggestions in your IDE  Get Codota for Java