public static Decoder getDecoder() {
        return new FrameDecoder() {
            @Override
            protected Object decode(NioChannel channel, byte[] frame) throws Exception {
                String json = new String(frame, "UTF-8");
                RemotingMsg msg = JSON.parse(json, new TypeReference<RemotingMsg>() {
                });
                return msg;
            }
        };
    }
@author Robert HG (254963746@qq.com) on 2/3/16.
lts-core/src/test/java/com/github/ltsopensource/nio/CodecFactory.java