Replaced PacketWriter methods with a constant.

This commit is contained in:
akwizgran
2016-02-11 16:21:26 +00:00
parent 747d9678fe
commit 0c392e8b78
7 changed files with 15 additions and 125 deletions

View File

@@ -4,12 +4,6 @@ import java.io.IOException;
public interface PacketWriter {
int getMaxMessagesForAck(long capacity);
int getMaxMessagesForRequest(long capacity);
int getMaxMessagesForOffer(long capacity);
void writeAck(Ack a) throws IOException;
void writeMessage(byte[] raw) throws IOException;

View File

@@ -24,4 +24,7 @@ public interface SyncConstants {
/** The maximum length of a message body in bytes. */
int MAX_MESSAGE_BODY_LENGTH = MAX_MESSAGE_LENGTH - MESSAGE_HEADER_LENGTH;
/** The maximum number of message IDs in an ack, offer or request packet. */
int MAX_MESSAGE_IDS = MAX_PACKET_PAYLOAD_LENGTH / UniqueId.LENGTH;
}