Expose serialisation overhead without breaking encapsulation.

This commit is contained in:
akwizgran
2011-09-21 13:16:58 +01:00
parent 95c3fb4fed
commit 3e60233ae0
13 changed files with 130 additions and 83 deletions

View File

@@ -5,9 +5,6 @@ import java.util.Collection;
/** A packet acknowledging receipt of one or more batches. */
public interface Ack {
/** The maximum number of batch IDs per ack. */
static final int MAX_IDS_PER_ACK = 29959;
/** Returns the IDs of the acknowledged batches. */
Collection<BatchId> getBatchIds();
}

View File

@@ -5,9 +5,6 @@ import java.util.Collection;
/** A packet offering the recipient some messages. */
public interface Offer {
/** The maximum number of message IDs per offer. */
static final int MAX_IDS_PER_OFFER = 29959;
/** Returns the message IDs contained in the offer. */
Collection<MessageId> getMessageIds();
}

View File

@@ -6,7 +6,7 @@ import java.util.Map;
public interface SubscriptionUpdate {
/** The maximum number of subscriptions per update. */
static final int MAX_SUBS_PER_UPDATE = 6393;
static final int MAX_SUBS_PER_UPDATE = 6000;
/** Returns the subscriptions contained in the update. */
Map<Group, Long> getSubscriptions();

View File

@@ -0,0 +1,12 @@
package net.sf.briar.api.serial;
public interface SerialComponent {
int getSerialisedListEndLength();
int getSerialisedListStartLength();
int getSerialisedUniqueIdLength(int id);
int getSerialisedUserDefinedIdLength(int id);
}