Skip to content

Instantly share code, notes, and snippets.

@jartur
Created July 7, 2010 02:51
Show Gist options
  • Save jartur/466244 to your computer and use it in GitHub Desktop.
Save jartur/466244 to your computer and use it in GitHub Desktop.
pipeline.addLast("encoder", new OneToOneEncoder() {
@Override
protected Object encode(ChannelHandlerContext channelHandlerContext, Channel channel, Object o) throws Exception
{
Server.getStatisticator().increaseResponses();
Response response = (Response) o;
byte[] bytes = response.getXML().getBytes();
if (Server.isUseEncoder())
{
bytes = AESEncryptor.encrypt(bytes);
}
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
buf.writeBytes(bytes);
return buf;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment