Removed AckPacket and added writeAck function to SinglePacket

This commit is contained in:
Collin Smith 2020-06-22 12:27:11 -07:00
parent 990910393b
commit fbc4019b23

View File

@ -178,6 +178,16 @@ public abstract class Packet {
writeAckBitByteFlags(bb, ackBits);
}
static void writeAck(ByteBuf bb, int channelId, int ack, int ackBits) {
int prefixByte = getAckBitByteFlags(ackBits, ACK);
bb.writeByte(prefixByte);
bb.writeByte(channelId);
bb.writeShortLE(ack);
writeAckBitByteFlags(bb, ackBits);
}
}
static class FragmentedPacket extends Packet {
@ -270,16 +280,4 @@ public abstract class Packet {
return headerSize;
}
}
static class AckPacket {
static void writeHeader(ByteBuf bb, int channelId, int ack, int ackBits) {
int prefixByte = getAckBitByteFlags(ackBits, ACK);
bb.writeByte(prefixByte);
bb.writeByte(channelId);
bb.writeShortLE(ack);
writeAckBitByteFlags(bb, ackBits);
}
}
}