Files
briar/components/net/sf/briar/plugins/bluetooth/BluetoothTransportConnection.java
akwizgran d48c7b6900 Converted {Incoming,Outgoing}BatchConnection into Runnables.
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.
2011-10-14 16:14:29 +01:00

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());
}
}
}