|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object org.jboss.netty.channel.SimpleChannelUpstreamHandler org.jboss.netty.handler.codec.frame.FrameDecoder org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder
public class DelimiterBasedFrameDecoder
A decoder that splits the received ChannelBuffer
s by one or more
delimiters. It is particularly useful for decoding the frames which ends
with a delimiter such as NUL
or
newline characters.
Delimiters
defines frequently used delimiters for convenience' sake.
DelimiterBasedFrameDecoder
allows you to specify more than one
delimiter. If more than one delimiter is found in the buffer, it chooses
the delimiter which produces the shortest frame. For example, if you have
the following data in the buffer:
+--------------+ | ABC\nDEF\r\n | +--------------+a
DelimiterBasedFrameDecoder
(
Delimiters.lineDelimiter()
)
will choose '\n'
as the first delimiter and produce two frames:
+-----+-----+ | ABC | DEF | +-----+-----+rather than incorrectly choosing
'\r\n'
as the first delimiter:
+----------+ | ABC\nDEF | +----------+
嵌套类摘要 |
---|
从接口 org.jboss.netty.channel.ChannelHandler 继承的嵌套类/接口 |
---|
ChannelHandler.Sharable |
构造方法摘要 | |
---|---|
DelimiterBasedFrameDecoder(int maxFrameLength,
boolean stripDelimiter,
ChannelBuffer... delimiters)
Creates a new instance. |
|
DelimiterBasedFrameDecoder(int maxFrameLength,
boolean stripDelimiter,
ChannelBuffer delimiter)
Creates a new instance. |
|
DelimiterBasedFrameDecoder(int maxFrameLength,
ChannelBuffer... delimiters)
Creates a new instance. |
|
DelimiterBasedFrameDecoder(int maxFrameLength,
ChannelBuffer delimiter)
Creates a new instance. |
方法摘要 |
---|
从类 org.jboss.netty.handler.codec.frame.FrameDecoder 继承的方法 |
---|
channelClosed, channelDisconnected, exceptionCaught, messageReceived |
从类 org.jboss.netty.channel.SimpleChannelUpstreamHandler 继承的方法 |
---|
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public DelimiterBasedFrameDecoder(int maxFrameLength, ChannelBuffer delimiter)
maxFrameLength
- the maximum length of the decoded frame.
A TooLongFrameException
is thrown if
the length of the frame exceeds this value.delimiter
- the delimiterpublic DelimiterBasedFrameDecoder(int maxFrameLength, boolean stripDelimiter, ChannelBuffer delimiter)
maxFrameLength
- the maximum length of the decoded frame.
A TooLongFrameException
is thrown if
the length of the frame exceeds this value.stripDelimiter
- whether the decoded frame should strip out the
delimiter or notdelimiter
- the delimiterpublic DelimiterBasedFrameDecoder(int maxFrameLength, ChannelBuffer... delimiters)
maxFrameLength
- the maximum length of the decoded frame.
A TooLongFrameException
is thrown if
the length of the frame exceeds this value.delimiters
- the delimiterspublic DelimiterBasedFrameDecoder(int maxFrameLength, boolean stripDelimiter, ChannelBuffer... delimiters)
maxFrameLength
- the maximum length of the decoded frame.
A TooLongFrameException
is thrown if
the length of the frame exceeds this value.stripDelimiter
- whether the decoded frame should strip out the
delimiter or notdelimiters
- the delimiters
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |