Code example for CharsetEncoder

Methods: encode

0
    } 
 
    public void respondTo(EvtJClient recipient, String msg) {
        try { 
            recipient.getChannel().write(
                    encoder.encode(CharBuffer.wrap(msg)));
        } catch (IOException e) {
            e.printStackTrace();
        } 
    } 
 
    public abstract void serveRequest(EvtJClient client, String request);
 
    public void run() { 
        serveRequest(request.getClient(), request.getRequest());
    } 
 
}