mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Also changed the dispose() method of readers/writers/connections to swallow any exceptions that occur, since the caller can't do anything except log them.
40 lines
971 B
Java
40 lines
971 B
Java
package net.sf.briar.plugins.bluetooth;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
|
|
import javax.microedition.io.StreamConnection;
|
|
|
|
import net.sf.briar.api.transport.StreamTransportConnection;
|
|
|
|
class BluetoothTransportConnection implements StreamTransportConnection {
|
|
|
|
private static final Logger LOG =
|
|
Logger.getLogger(BluetoothTransportConnection.class.getName());
|
|
|
|
private final StreamConnection stream;
|
|
|
|
BluetoothTransportConnection(StreamConnection stream) {
|
|
this.stream = stream;
|
|
}
|
|
|
|
public InputStream getInputStream() throws IOException {
|
|
return stream.openInputStream();
|
|
}
|
|
|
|
public OutputStream getOutputStream() throws IOException {
|
|
return stream.openOutputStream();
|
|
}
|
|
|
|
public void dispose(boolean success) {
|
|
try {
|
|
stream.close();
|
|
} catch(IOException e) {
|
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage());
|
|
}
|
|
}
|
|
}
|