mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 15:19:53 +01:00
Converted the outgoing encryption layer from frames to segments.
This commit is contained in:
@@ -3,6 +3,8 @@ package net.sf.briar.transport;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.sf.briar.api.plugins.Segment;
|
||||
|
||||
/** An encryption layer that performs no encryption. */
|
||||
class NullOutgoingEncryptionLayer implements OutgoingEncryptionLayer {
|
||||
|
||||
@@ -20,9 +22,9 @@ class NullOutgoingEncryptionLayer implements OutgoingEncryptionLayer {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public void writeFrame(byte[] b, int len) throws IOException {
|
||||
out.write(b, 0, len);
|
||||
capacity -= len;
|
||||
public void writeSegment(Segment s) throws IOException {
|
||||
out.write(s.getBuffer(), 0, s.getLength());
|
||||
capacity -= s.getLength();
|
||||
}
|
||||
|
||||
public void flush() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user