Building a Netty ChannelBuffer from a String

Converting a Netty ChannelBuffer to String is as simple as calling .toString (UTF_8) on a ChannelBuffer. How to create a channelbuffer from a string?

+3
source share
2 answers

Use ChannelBuffers.copiedBuffer (String, Charset)

+9
source

In netty 4 you can use Unpooled.copiedBuffer(String, Charset)

+1
source

All Articles