public OutputStream openOutputStream() throws IOException { return ((OutputConnection) impl).openOutputStream(); }
public DataOutputStream openDataOutputStream() throws IOException { return new DataOutputStream(openOutputStream()); }
public DataOutputStream openDataOutputStream() throws IOException { return new DataOutputStream(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 OutputStream openOutputStream(String name) throws IOException { return ((OutputConnection) open(name)).openOutputStream(); }
/** * @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(); }
public static OutputStream openOutputStream(String name) throws IOException { OutputConnection con = ((OutputConnection) openImpl(name, WRITE, false, false)); try { return con.openOutputStream(); } finally { con.close(); } }
protected OutputStream connect() throws IOException { connection = (HttpConnection) Connector.open(postURL); connection.setRequestMethod(HttpConnection.POST); return connection.openOutputStream(); }
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); } } } }