Reputation: 16718
To convert a Netty ChannelBuffer to a String is as simple as calling .toString(UTF_8) on the ChannelBuffer. How do I create a ChannelBuffer from a String?
Upvotes: 3
Views: 4063
Reputation: 30954
In netty 4 you can use Unpooled.copiedBuffer(String, Charset)
Unpooled.copiedBuffer(String, Charset)
Upvotes: 1
Reputation: 23567
Use ChannelBuffers.copiedBuffer(String, Charset)
Upvotes: 9