Example usage for io.netty.util CharsetUtil UTF_16

List of usage examples for io.netty.util CharsetUtil UTF_16

Introduction

In this page you can find the example usage for io.netty.util CharsetUtil UTF_16.

Prototype

Charset UTF_16

To view the source code for io.netty.util CharsetUtil UTF_16.

Click Source Link

Document

16-bit UTF (UCS Transformation Format) whose byte order is identified by an optional byte-order mark

Usage

From source file:org.opendaylight.groupbasedpolicy.jsonrpc.JsonRpcDecoderTest.java

License:Open Source License

@Test(expected = DecoderException.class)
public void testDecodeInvalidEncoding() throws Exception {
    ch.writeInbound(copiedBuffer(testJson, CharsetUtil.UTF_16));
    ch.finish();/*from   ww w  .j  a v a2 s.c  om*/
}

From source file:org.opendaylight.ovsdb.lib.jsonrpc.JsonRpcDecoderTest.java

License:Open Source License

/**
 * Test whether decoder throws appropriate DecoderException when
 * passing a Json string using an unsupported (i.e., UTF-16)
 * character set./*ww  w  . j a  v a  2  s  .  c  o  m*/
 * @throws Exception
 */
@Test(expected = DecoderException.class)
public void testDecodeInvalidEncoding() throws Exception {
    ch.writeInbound(copiedBuffer(testJson, CharsetUtil.UTF_16));
    ch.finish();
}