public DataOutputStream openDataOutputStream() throws IOException { return ((OutputConnection) impl).openDataOutputStream(); }
public DataOutputStream openDataOutputStream(String name) throws IOException { return ((OutputConnection) open(name)).openDataOutputStream(); }
/** * Open the log, i.e. it opens the <code>CommConnection</code>. * * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public void open() throws IOException { // If no serial port is defined, use the first available port if (comPort == null) { String ports = System.getProperty("microedition.commports"); int comma = ports.indexOf(','); if (comma > 0) { // Parse the first port from the available ports list. comPort = ports.substring(0, comma); } else { // Only one serial port available. comPort = ports; } } String connectionString = SerialAppender.COMM_SCHEME + comPort; connection = (CommConnection) Connector.open(connectionString); dataOutputStream = connection.openDataOutputStream(); logOpen = true; }
/** * @see org.osgi.service.io.ConnectorService#openDataOutputStream(java.lang.String) */ public DataOutputStream openDataOutputStream(String name) throws IOException { Connection connection = open(name, WRITE, false); if (!(connection instanceof OutputConnection)) { try { connection.close(); } catch (IOException ioex) { } throw new IOException("Connection doesn't implement OutputConnection" + connection.getClass()); } return ((OutputConnection) connection).openDataOutputStream(); }
/** * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public synchronized void open() throws IOException { if (socketConnection == null && serverName != null) { String connectionString = protocol + serverName + ':' + port; socketConnection = (SocketConnection) Connector .open(connectionString); socketConnection.setSocketOption(SocketConnection.LINGER, linger); dataOutputStream = socketConnection.openDataOutputStream(); logOpen = true; } }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static DataOutputStream openDataOutputStream(String name) throws IOException { Connection c= Connector.open(name, Connector.WRITE); try { if(!(c instanceof OutputConnection)) { throw new IllegalArgumentException(name + " does not refer to an OutputConnection"); } return ((OutputConnection) c).openDataOutputStream(); } finally { c.close(); } }