Expose the encryption and authentication overhead without breaking

encapsulation.

This should allow callers to calculate maximum packet sizes without
knowing the details of the transport protocol.
This commit is contained in:
akwizgran
2011-09-21 15:22:25 +01:00
parent 7e58b25618
commit 10c3b21726
10 changed files with 115 additions and 35 deletions

View File

@@ -11,4 +11,11 @@ interface ConnectionEncrypter {
/** Encrypts and writes the MAC for the current frame. */
void writeMac(byte[] mac) throws IOException;
/**
* Returns the number of encrypted bytes that can be written without
* writing more than the given number of bytes, including encryption
* overhead.
*/
long getCapacity(long capacity);
}