Name
javax.microedition.io.Connector
Synopsis
This class acts as a placeholder for the class methods that are used
to create all the connection objects. When opening a connection, an
access mode can be specified as READ
,
WRITE
, or READ_WRITE
. This
means that a connection can be used for reading, writing, or both.
This, however, is protocol-dependent, as some protocol connections
may not allow READ
access (a connection to a
printer, for example). In this case an
IllegalArgumentException
will be thrown. If no
access mode is specified, then the default
READ_WRITE
will be used.
public classConnector { // public class fields public static final int READ = 1; public static final int WRITE = 2; public static final int READ_WRITE = (READ|WRITE); // public class methods public static Connection open(String name) throws IOException; public static Connection open(String name, int mode) throws IOException; public static Connection open(String name, int mode, boolean timeouts) throws IOException; public static DataInputStream openDataInputStream(String name) throws IOException; public static DataOutputStream openDataOutputStream(String name) throws IOException; public static InputStream openInputStream(String name) throws IOException; public static OutputStream openOutputStream(String name) throws IOException; }
Get Wireless Java 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.