mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
30 lines
659 B
Java
30 lines
659 B
Java
package net.sf.briar.transport;
|
|
|
|
import java.io.EOFException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
|
|
/** A ConnectionDecrypter that performs no decryption. */
|
|
class NullConnectionDecrypter implements ConnectionDecrypter {
|
|
|
|
private final InputStream in;
|
|
|
|
NullConnectionDecrypter(InputStream in) {
|
|
this.in = in;
|
|
}
|
|
|
|
public InputStream getInputStream() {
|
|
return in;
|
|
}
|
|
|
|
public void readFinal(byte[] mac) throws IOException {
|
|
int offset = 0;
|
|
while(offset < mac.length) {
|
|
int read = in.read(mac, offset, mac.length - offset);
|
|
if(read == -1) break;
|
|
offset += read;
|
|
}
|
|
if(offset < mac.length) throw new EOFException();
|
|
}
|
|
}
|