Allow the transport to specify the maximum segment length.

This commit is contained in:
akwizgran
2012-01-20 23:06:51 +00:00
parent 13eff752da
commit 3a77ba9aaf
34 changed files with 195 additions and 39 deletions

View File

@@ -1,5 +1,8 @@
package net.sf.briar.transport;
import static net.sf.briar.api.transport.TransportConstants.MAX_SEGMENT_LENGTH;
import static net.sf.briar.api.transport.TransportConstants.TAG_LENGTH;
import java.io.IOException;
import java.io.OutputStream;
@@ -34,4 +37,8 @@ class NullOutgoingEncryptionLayer implements OutgoingEncryptionLayer {
public long getRemainingCapacity() {
return capacity;
}
public int getMaxSegmentLength() {
return MAX_SEGMENT_LENGTH - TAG_LENGTH;
}
}