public class ParamsContentParser extends ContentParser
Parser for the PARAMS frame body.
struct small_name_small_value_params_body { ubyte nameLength; ubyte valueLength; ubyte[] nameBytes; ubyte[] valueBytes; } struct small_name_large_value_params_body { ubyte nameLength; uint valueLength; ubyte[] nameBytes; ubyte[] valueBytes; } struct large_name_small_value_params_body { uint nameLength; ubyte valueLength; ubyte[] nameBytes; ubyte[] valueBytes; } struct large_name_large_value_params_body { uint nameLength; uint valueLength; ubyte[] nameBytes; ubyte[] valueBytes; }
Modifier and Type | Class and Description |
---|---|
private static class |
ParamsContentParser.State |
ContentParser.Result
Modifier and Type | Field and Description |
---|---|
private int |
cursor |
private int |
length |
private ServerParser.Listener |
listener |
private static Logger |
LOG |
private byte[] |
nameBytes |
private int |
nameLength |
private ParamsContentParser.State |
state |
private byte[] |
valueBytes |
private int |
valueLength |
Constructor and Description |
---|
ParamsContentParser(HeaderParser headerParser,
ServerParser.Listener listener) |
Modifier and Type | Method and Description |
---|---|
private boolean |
isLargeLength(java.nio.ByteBuffer buffer) |
void |
noContent() |
protected void |
onParam(java.lang.String name,
java.lang.String value) |
protected void |
onParams() |
ContentParser.Result |
parse(java.nio.ByteBuffer buffer) |
private void |
partialReset() |
private void |
reset() |
getContentLength, getRequest
private static final Logger LOG
private final ServerParser.Listener listener
private ParamsContentParser.State state
private int cursor
private int length
private int nameLength
private int valueLength
private byte[] nameBytes
private byte[] valueBytes
public ParamsContentParser(HeaderParser headerParser, ServerParser.Listener listener)
public ContentParser.Result parse(java.nio.ByteBuffer buffer)
parse
in class ContentParser
public void noContent()
noContent
in class ContentParser
protected void onParam(java.lang.String name, java.lang.String value)
protected void onParams()
private boolean isLargeLength(java.nio.ByteBuffer buffer)
private void partialReset()
private void reset()