Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

Foundation 1.1.2

javax.microedition.io
Interface StreamConnection

All Superinterfaces:
Connection, InputConnection, OutputConnection
All Known Subinterfaces:
CommConnection, ContentConnection, HttpConnection, HttpsConnection, SecureConnection, SocketConnection

public interface StreamConnection
extends InputConnection, OutputConnection

This interface defines the capabilities that a stream connection must have.

In a typical implementation of this interface (for instance in MIDP 2.0), all StreamConnections have one underlying InputStream and one OutputStream. Opening a DataInputStream counts as opening an InputStream and opening a DataOutputStream counts as opening an OutputStream. Trying to open another InputStream or OutputStream causes an IOException. Trying to open the InputStream or OutputStream after they have been closed causes an IOException.

NOTE of clarification for implementations supporting multiple streams: Each openXXXStream (where XXX can be either Input or Output) call returns a unique new stream, not a copy of a single stream. When an opened stream is closed, a StreamConnection implementation may choose to close the connection and close all other opened streams derived from that connection. When this choice of implementation happens, further access to the connection and streams will throw an IOException. When this choice of implementation is not chosen, where one opened stream is closed, all other opened streams must remain open and any other openXXXStream call is valid and must return a new unique XXXStream.

The methods of StreamConnection are not synchronized. The only stream method that can be called safely in another thread is close.

Since:
CLDC 1.0

Methods inherited from interface javax.microedition.io.InputConnection
openDataInputStream, openInputStream
 
Methods inherited from interface javax.microedition.io.Connection
close
 
Methods inherited from interface javax.microedition.io.OutputConnection
openDataOutputStream, openOutputStream
 


Foundation 1.1.2

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 219 specification.