Name
OutputConnection
Synopsis
OutputConnection is an interface implemented by
connections that can provide an output stream to the data source.
The openOutputStream() obtains an output stream that can
be used to write an ordered sequence of bytes from the data source, while
openDataOutputStream returns a stream that can be used to
write Java primitive data types to the connection in a platform-independent
format. Data written using the latter method can be retrieved on the
other side using a DataInputStream.
The result of calling these methods more than once is not defined by the
specification. Sun’s reference implementations treat a second call as an
error and throw an IOException. The
openOutputStream() and
openDataOutputStream() methods will also throw an
IOException if the OutputConnection
was obtained from a Connector
open()
call which specified a mode of Connector.READ.
public interface OutputConnection extends Connection {
// Public Instance Methods
public abstract java.io.DataOutputStream openDataOutputStream(
) throws java.io.IOException;
public abstract java.io.OutputStream openOutputStream(
) throws java.io.IOException;
}
Implementations
StreamConnection
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access