public abstract class ByteToMessageCodec<I>
extends io.netty.channel.ChannelDuplexHandler
implements io.netty.channel.ChannelInboundByteHandler, io.netty.channel.ChannelOutboundMessageHandler<I>
Modifier | Constructor and Description |
---|---|
protected |
ByteToMessageCodec() |
protected |
ByteToMessageCodec(Class<? extends I> outboundMessageType) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptOutboundMessage(Object msg) |
protected abstract void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
io.netty.buffer.MessageBuf<Object> out) |
protected void |
decodeLast(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
io.netty.buffer.MessageBuf<Object> out) |
void |
discardInboundReadBytes(io.netty.channel.ChannelHandlerContext ctx) |
protected abstract void |
encode(io.netty.channel.ChannelHandlerContext ctx,
I msg,
io.netty.buffer.ByteBuf out) |
void |
flush(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
inboundBufferUpdated(io.netty.channel.ChannelHandlerContext ctx) |
io.netty.buffer.ByteBuf |
newInboundBuffer(io.netty.channel.ChannelHandlerContext ctx) |
io.netty.buffer.MessageBuf<I> |
newOutboundBuffer(io.netty.channel.ChannelHandlerContext ctx) |
bind, close, connect, deregister, disconnect, read, sendFile
channelActive, channelInactive, channelReadSuspended, channelRegistered, channelUnregistered, userEventTriggered
exceptionCaught, handlerAdded, handlerRemoved
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
channelActive, channelInactive, channelReadSuspended, channelRegistered, channelUnregistered, userEventTriggered
public io.netty.buffer.ByteBuf newInboundBuffer(io.netty.channel.ChannelHandlerContext ctx) throws Exception
newInboundBuffer
in interface io.netty.channel.ChannelInboundByteHandler
Exception
public void discardInboundReadBytes(io.netty.channel.ChannelHandlerContext ctx) throws Exception
discardInboundReadBytes
in interface io.netty.channel.ChannelInboundByteHandler
Exception
public io.netty.buffer.MessageBuf<I> newOutboundBuffer(io.netty.channel.ChannelHandlerContext ctx) throws Exception
public void inboundBufferUpdated(io.netty.channel.ChannelHandlerContext ctx) throws Exception
inboundBufferUpdated
in interface io.netty.channel.ChannelStateHandler
Exception
public void flush(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws Exception
flush
in interface io.netty.channel.ChannelOperationHandler
Exception
public boolean acceptOutboundMessage(Object msg) throws Exception
Exception
protected abstract void encode(io.netty.channel.ChannelHandlerContext ctx, I msg, io.netty.buffer.ByteBuf out) throws Exception
Exception
protected abstract void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, io.netty.buffer.MessageBuf<Object> out) throws Exception
Exception
Copyright © 2008-2013 The Netty Project. All Rights Reserved.