Class HAProxyMessageDecoder.HeaderExtractor
java.lang.Object
io.netty.handler.codec.haproxy.HAProxyMessageDecoder.HeaderExtractor
- Direct Known Subclasses:
HAProxyMessageDecoder.LineHeaderExtractor, HAProxyMessageDecoder.StructHeaderExtractor
- Enclosing class:
HAProxyMessageDecoder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intdelimiterLength(ByteBuf buffer, int eoh) Get the length of the header delimiter.extract(ChannelHandlerContext ctx, ByteBuf buffer) Create a frame out of theByteBufand return it.protected abstract intfindEndOfHeader(ByteBuf buffer) Find the end of the header from the givenByteBuf,the end may be a CRLF, or the length given by the header.
-
Field Details
-
maxHeaderSize
private final int maxHeaderSizeHeader max size
-
-
Constructor Details
-
HeaderExtractor
protected HeaderExtractor(int maxHeaderSize)
-
-
Method Details
-
extract
Create a frame out of theByteBufand return it.- Parameters:
ctx- theChannelHandlerContextwhich thisHAProxyMessageDecoderbelongs tobuffer- theByteBuffrom which to read data- Returns:
- frame the
ByteBufwhich represent the frame ornullif no frame could be created - Throws:
Exception- if exceed maxLength
-
findEndOfHeader
-
delimiterLength
Get the length of the header delimiter.- Parameters:
buffer- the buffer where delimiter is locatedeoh- index of delimiter- Returns:
- length of the delimiter
-