public abstract class ByteToMessageDecoder<O>
extends io.netty.channel.ChannelInboundHandlerAdapter
implements io.netty.channel.ChannelInboundByteHandler
Constructor and Description |
---|
ByteToMessageDecoder() |
Modifier and Type | Method and Description |
---|---|
void |
beforeAdd(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
callDecode(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
abstract O |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in) |
O |
decodeLast(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in) |
void |
inboundBufferUpdated(io.netty.channel.ChannelHandlerContext ctx) |
io.netty.buffer.ByteBuf |
newInboundBuffer(io.netty.channel.ChannelHandlerContext ctx) |
void |
replace(String newHandlerName,
io.netty.channel.ChannelInboundByteHandler newHandler)
Replace this decoder in the
ChannelPipeline with the given handler. |
afterAdd, afterRemove, beforeRemove, channelActive, channelRegistered, channelUnregistered, exceptionCaught, userEventTriggered
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void beforeAdd(io.netty.channel.ChannelHandlerContext ctx) throws Exception
beforeAdd
in interface io.netty.channel.ChannelHandler
beforeAdd
in class io.netty.channel.ChannelStateHandlerAdapter
Exception
public io.netty.buffer.ByteBuf newInboundBuffer(io.netty.channel.ChannelHandlerContext ctx) throws Exception
newInboundBuffer
in interface io.netty.channel.ChannelInboundByteHandler
newInboundBuffer
in interface io.netty.channel.ChannelInboundHandler
Exception
public void inboundBufferUpdated(io.netty.channel.ChannelHandlerContext ctx) throws Exception
inboundBufferUpdated
in interface io.netty.channel.ChannelStateHandler
inboundBufferUpdated
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelStateHandler
channelInactive
in class io.netty.channel.ChannelStateHandlerAdapter
Exception
protected void callDecode(io.netty.channel.ChannelHandlerContext ctx)
public void replace(String newHandlerName, io.netty.channel.ChannelInboundByteHandler newHandler)
ChannelPipeline
with the given handler.
All remaining bytes in the inbound buffer will be forwarded to the new handler's
inbound buffer.public abstract O decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in) throws Exception
Exception
Copyright © 2008-2012 The Netty Project. All Rights Reserved.