ServerParserpublic class Parser
extends java.lang.Object
The HTTP/2 protocol parser.
This parser makes use of the HeaderParser and of
BodyParsers to parse HTTP/2 frames.
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
Parser.Listener |
| Constructor | Description |
|---|---|
Parser(ByteBufferPool byteBufferPool,
Parser.Listener listener,
int maxDynamicTableSize,
int maxHeaderSize) |
| Modifier and Type | Method | Description |
|---|---|---|
protected int |
getFrameType() |
|
protected boolean |
hasFlag(int bit) |
|
protected void |
notifyConnectionFailure(int error,
java.lang.String reason) |
|
void |
parse(java.nio.ByteBuffer buffer) |
Parses the given
buffer bytes and emit events to a Parser.Listener. |
protected boolean |
parseBody(java.nio.ByteBuffer buffer) |
|
protected boolean |
parseHeader(java.nio.ByteBuffer buffer) |
public Parser(ByteBufferPool byteBufferPool, Parser.Listener listener, int maxDynamicTableSize, int maxHeaderSize)
public void parse(java.nio.ByteBuffer buffer)
Parses the given buffer bytes and emit events to a Parser.Listener.
When this method returns, the buffer may not be fully consumed, so invocations to this method should be wrapped in a loop:
while (buffer.hasRemaining())
parser.parse(buffer);
buffer - the buffer to parseprotected boolean parseHeader(java.nio.ByteBuffer buffer)
protected boolean parseBody(java.nio.ByteBuffer buffer)
protected int getFrameType()
protected boolean hasFlag(int bit)
protected void notifyConnectionFailure(int error,
java.lang.String reason)
Copyright © 1995–2018 Webtide. All rights reserved.