Parser.DecodePayloadCallback<T>, Parser.EncodeCallback<T>
Modifier and Type | Field and Description |
---|---|
static int |
PROTOCOL |
ERROR_PACKET, PACKETS, PACKETS_REVERSE, PROTOCOL_V3, PROTOCOL_V4
Constructor and Description |
---|
ParserV4() |
Modifier and Type | Method and Description |
---|---|
Packet<?> |
decodePacket(Object data)
Decode a packet received from transport.
|
void |
decodePayload(Object data,
Parser.DecodePayloadCallback<Object> callback)
Decode payload received from transport.
|
static void |
encodeByteArray(Packet<byte[]> packet,
boolean supportsBinary,
Parser.EncodeCallback<Object> callback) |
void |
encodePacket(Packet<?> packet,
boolean supportsBinary,
Parser.EncodeCallback<Object> callback)
Encode a packet for transfer over transport.
|
void |
encodePayload(List<Packet<?>> packets,
boolean supportsBinary,
Parser.EncodeCallback<Object> callback)
Encode an array of packets into a payload for transfer over transport.
|
int |
getProtocolVersion() |
public static final int PROTOCOL
public int getProtocolVersion()
getProtocolVersion
in interface Parser
public void encodePacket(Packet<?> packet, boolean supportsBinary, Parser.EncodeCallback<Object> callback)
encodePacket
in interface Parser
packet
- The packet to encode.supportsBinary
- Whether the transport supports binary encoding.callback
- The callback to be called with the encoded data.public static void encodeByteArray(Packet<byte[]> packet, boolean supportsBinary, Parser.EncodeCallback<Object> callback)
public void encodePayload(List<Packet<?>> packets, boolean supportsBinary, Parser.EncodeCallback<Object> callback)
encodePayload
in interface Parser
packets
- Array of packets to encode.callback
- The callback to be called with the encoded data.public void decodePayload(Object data, Parser.DecodePayloadCallback<Object> callback)
decodePayload
in interface Parser
data
- Data received from transport.callback
- The callback to be called with each decoded packet in payload.public Packet<?> decodePacket(Object data)
decodePacket
in interface Parser
data
- Data received from transport.Copyright © 2022. All rights reserved.