mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
36 lines
865 B
Java
36 lines
865 B
Java
package org.briarproject.plugins.droidtooth;
|
|
|
|
import android.bluetooth.BluetoothSocket;
|
|
|
|
import org.briarproject.api.plugins.Plugin;
|
|
import org.briarproject.api.plugins.duplex.AbstractDuplexTransportConnection;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
|
|
class DroidtoothTransportConnection extends AbstractDuplexTransportConnection {
|
|
|
|
private final BluetoothSocket socket;
|
|
|
|
DroidtoothTransportConnection(Plugin plugin, BluetoothSocket socket) {
|
|
super(plugin);
|
|
this.socket = socket;
|
|
}
|
|
|
|
@Override
|
|
protected InputStream getInputStream() throws IOException {
|
|
return socket.getInputStream();
|
|
}
|
|
|
|
@Override
|
|
protected OutputStream getOutputStream() throws IOException {
|
|
return socket.getOutputStream();
|
|
}
|
|
|
|
@Override
|
|
protected void closeConnection(boolean exception) throws IOException {
|
|
socket.close();
|
|
}
|
|
}
|