I think what you want to use is ChannelBuffers.copiedString(s, charset) and then just set the buffer  on the Attribute