public interface PacketHeader
| Modifier and Type | Method and Description |
|---|---|
int |
getLengthSize()
Gets the size of the header's length value.
|
int |
getLengthSize(int length)
Gets the size of the header's length value.
|
boolean |
isLengthVariable()
Gets whether the header's length value can vary in size.
|
int |
readLength(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper,
int available)
Reads the length of a packet from the given input.
|
int |
readPacketId(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper)
Reads the ID of a packet from the given input.
|
void |
writeLength(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper,
int length)
Writes the length of a packet to the given output.
|
void |
writePacketId(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper,
int packetId)
Writes the ID of a packet to the given output.
|
boolean isLengthVariable()
int getLengthSize()
int getLengthSize(int length)
length - Length value to get the size of.int readLength(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper,
int available)
throws IOException
buf - Buffer to read from.codecHelper - The codec helper.available - Number of packet bytes available after the length.IOException - If an I/O error occurs.void writeLength(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper,
int length)
throws IOException
buf - Buffer to write to.codecHelper - The codec helper.length - Length to write.IOException - If an I/O error occurs.int readPacketId(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper)
throws IOException
buf - Buffer to read from.codecHelper - The codec helper.IOException - If an I/O error occurs.void writePacketId(io.netty.buffer.ByteBuf buf,
PacketCodecHelper codecHelper,
int packetId)
throws IOException
buf - Buffer to write to.codecHelper - The codec helper.packetId - Packet ID to write.IOException - If an I/O error occurs.Copyright © 2022. All rights reserved.