[ 
http://issues.apache.org/jira/browse/DIRMINA-247?page=comments#action_12432319 
] 
            
Frankie Huang commented on DIRMINA-247:
---------------------------------------

example code:

public class ICSProtocolHandler extends IoHandlerAdapter {
        public void dataRead(IoSession session, ByteBuffer rb) {
                try {
                        String buf = 
rb.getString(Charset.forName("UTF-16LE").newDecoder());
                        System.out.println("read[" + buf.length() + "]:" + buf);
                } catch (Exception ex) {
                        logger.error(ex.getMessage());
                        ex.printStackTrace();
                }
        }
}



> String getString(CharsetDecoder decoder)  throws an CharacterCodingException 
> in case UTF-16
> -------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-247
>                 URL: http://issues.apache.org/jira/browse/DIRMINA-247
>             Project: Directory MINA
>          Issue Type: Bug
>    Affects Versions: 0.8.2
>            Reporter: Frankie Huang
>            Priority: Minor
>
> String getString(CharsetDecoder decoder)  throws an CharacterCodingException 
> in case UTF-16, but it is OK in case of "decoder.decode(byteBuffer.buf())"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to