Plaintext frames don't need to include space for the MAC.

This commit is contained in:
akwizgran
2012-08-29 19:30:10 +01:00
parent 5b4f566822
commit 0b0fa76686
3 changed files with 49 additions and 44 deletions

View File

@@ -1,6 +1,7 @@
package net.sf.briar.transport;
import static net.sf.briar.api.transport.TransportConstants.HEADER_LENGTH;
import static net.sf.briar.api.transport.TransportConstants.MAC_LENGTH;
import java.io.IOException;
import java.io.InputStream;
@@ -16,7 +17,7 @@ class ConnectionReaderImpl extends InputStream implements ConnectionReader {
ConnectionReaderImpl(FrameReader in, int frameLength) {
this.in = in;
frame = new byte[frameLength];
frame = new byte[frameLength - MAC_LENGTH];
}
public InputStream getInputStream() {

View File

@@ -27,7 +27,7 @@ class ConnectionWriterImpl extends OutputStream implements ConnectionWriter {
ConnectionWriterImpl(FrameWriter out, int frameLength) {
this.out = out;
this.frameLength = frameLength;
frame = new byte[frameLength];
frame = new byte[frameLength - MAC_LENGTH];
}
public OutputStream getOutputStream() {