netty 打印hex数据
public static void logger(ByteBuf byteBuf){
int length = byteBuf.readableBytes();
int rows = length / 16 + (length % 15 == 0 ? 0 : 1) + 4;
StringBuilder stringBuilder = new StringBuilder(rows * 80 *2);
stringBuilder.append("read index:").append(byteBuf.readerIndex())
.append("wread index:").append(byteBuf.writerIndex())
.append("capacity:").append(byteBuf.capacity())
.append(NEWLINE);
ByteBufUtil.appendPrettyHexDump(stringBuilder,byteBuf);
System.out.println(stringBuilder.toString());
}