How to convert a netty ByteBuf to a String and vice versa
You can use ByteBuf.toString(Charset)
to convert to string.
You can use String.getBytes(Charset)
and Unpooled.wrappedBuffer(byte[])
to convert to ByteBuf.
You can create a ByteBuf
from a String with Unpooled.copiedBuffer(String, Charset)
.