public class HeaderParser
extends java.lang.Object
The parser for the frame header of HTTP/2 frames.
Parser
Modifier and Type | Class and Description |
---|---|
private static class |
HeaderParser.State |
Modifier and Type | Field and Description |
---|---|
private int |
cursor |
private int |
flags |
private int |
length |
private HeaderParser.State |
state |
private int |
streamId |
private int |
type |
Constructor and Description |
---|
HeaderParser() |
Modifier and Type | Method and Description |
---|---|
int |
getFrameType() |
int |
getLength() |
int |
getStreamId() |
boolean |
hasFlag(int bit) |
boolean |
parse(java.nio.ByteBuffer buffer)
Parses the header bytes in the given
buffer ; only the header
bytes are consumed, therefore when this method returns, the buffer may
contain unconsumed bytes. |
protected void |
reset() |
java.lang.String |
toString() |
private HeaderParser.State state
private int cursor
private int length
private int type
private int flags
private int streamId
protected void reset()
public boolean parse(java.nio.ByteBuffer buffer)
Parses the header bytes in the given buffer
; only the header
bytes are consumed, therefore when this method returns, the buffer may
contain unconsumed bytes.
buffer
- the buffer to parsepublic int getLength()
public int getFrameType()
public boolean hasFlag(int bit)
public int getStreamId()
public java.lang.String toString()
toString
in class java.lang.Object