1、java二進制編解碼
byteBuffer.flip()
byteBuffer.getInt() 與 byteBuf.getInt(11)
2、粘包拆包問題
LengthFieldBasedFrameDecoder(2048,4,4,-8,0)
3、netty客戶端與其他服務器交互
@Override public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { ctx.flush(); ctx.close(); }
4、中文字節
中文字符占兩個字節,注意獲取數據長度要將字符getBytes()后
5、javaBean與XML字符串轉換
JAXB工具
6、Java泛型