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
Get J2ME in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.