public DataOutputStream openDataOutputStream() throws IOException { return ((OutputConnection) impl).openDataOutputStream(); }
public OutputStream openOutputStream() throws IOException { return ((OutputConnection) impl).openOutputStream(); }
OutputConnection connection = (OutputConnection) Connector.open("file://c:/myfile.txt;append=true", Connector.WRITE ); OutputStream out = connection.openOutputStream(); PrintStream output = new PrintStream( out ); output.println( "This is a test." ); out.close(); connection.close();
public DataOutputStream openDataOutputStream() throws IOException { return new DataOutputStream(openOutputStream()); }
public DataOutputStream openDataOutputStream(String name) throws IOException { return ((OutputConnection) open(name)).openDataOutputStream(); }
public DataOutputStream openDataOutputStream() throws IOException { return new DataOutputStream(openOutputStream()); }
/** * 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; }
public OutputStream openOutputStream(String name) throws IOException { return ((OutputConnection) open(name)).openOutputStream(); }
/** * @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 org.osgi.service.io.ConnectorService#openOutputStream(java.lang.String) */ public OutputStream openOutputStream(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).openOutputStream(); }
/** * @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; } }
protected OutputStream connect() throws IOException { connection = (HttpConnection) Connector.open(postURL); connection.setRequestMethod(HttpConnection.POST); return connection.openOutputStream(); }
/** * @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(); } }
public static OutputStream openOutputStream(String name) throws IOException { OutputConnection con = ((OutputConnection) openImpl(name, WRITE, false, false)); try { return con.openOutputStream(); } finally { con.close(); } }
public OBEXSessionBase(StreamConnection conn, OBEXConnectionParams obexConnectionParams) throws IOException { if (obexConnectionParams == null) { throw new NullPointerException("obexConnectionParams is null"); } this.isConnected = false; this.conn = conn; this.obexConnectionParams = obexConnectionParams; this.mtu = obexConnectionParams.mtu; this.connectionID = -1; this.packetsCountWrite = 0; this.packetsCountRead = 0; boolean initOK = false; try { this.os = conn.openOutputStream(); this.is = conn.openInputStream(); initOK = true; } finally { if (!initOK) { try { this.close(); } catch (IOException e) { DebugLog.error("close error", e); } } } }