Skip to content

Instantly share code, notes, and snippets.

@md-5
Created March 14, 2013 08:40
Show Gist options
  • Save md-5/5159811 to your computer and use it in GitHub Desktop.
Save md-5/5159811 to your computer and use it in GitHub Desktop.
Byte array
package net.md_5.bungee.netty;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
@ChannelHandler.Sharable
public class ByteArrayEncoder extends MessageToByteEncoder<byte[]>
{
@Override
protected void encode(ChannelHandlerContext ctx, byte[] msg, ByteBuf out) throws Exception
{
out.writeBytes( msg );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment