Updated transport constants and renamed some test classes.

This commit is contained in:
akwizgran
2012-01-17 14:56:30 +00:00
parent 9bd0b60dec
commit 8c0020873c
24 changed files with 181 additions and 178 deletions

View File

@@ -0,0 +1,35 @@
package net.sf.briar.transport;
import java.io.IOException;
import java.io.OutputStream;
/** An encryption layer that performs no encryption. */
class NullOutgoingEncryptionLayer implements OutgoingEncryptionLayer {
private final OutputStream out;
private long capacity;
NullOutgoingEncryptionLayer(OutputStream out) {
this.out = out;
capacity = Long.MAX_VALUE;
}
NullOutgoingEncryptionLayer(OutputStream out, long capacity) {
this.out = out;
this.capacity = capacity;
}
public void writeFrame(byte[] b, int len) throws IOException {
out.write(b, 0, len);
capacity -= len;
}
public void flush() throws IOException {
out.flush();
}
public long getRemainingCapacity() {
return capacity;
}
}