|
SunSPOT API V4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.squawk.io.ConnectionBase com.sun.squawk.io.j2me.edemoserial.Protocol
public class Protocol
serial.Protocol - provides read access to the serial/USB port for an eSPOT
Constructor Summary | |
---|---|
Protocol()
|
Method Summary | |
---|---|
void |
close()
Close |
long |
getTimeout()
Get the timeout for receiving information on this connection |
Connection |
open(String protocol,
String name,
int mode,
boolean timeouts)
Open a connection to a target. |
InputStream |
openInputStream()
Open and return a data input stream for a connection. |
OutputStream |
openOutputStream()
Open and return a data output stream for a connection. |
static void |
setResourceRegistry(IResourceRegistry resourceRegistry)
This method is provided for test purposes only. |
void |
setTimeout(long timeout)
Set the timeout for receiving information on this connection |
Methods inherited from class com.sun.squawk.io.ConnectionBase |
---|
openDataInputStream, openDataOutputStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.microedition.io.InputConnection |
---|
openDataInputStream |
Methods inherited from interface javax.microedition.io.OutputConnection |
---|
openDataOutputStream |
Constructor Detail |
---|
public Protocol()
Method Detail |
---|
public static void setResourceRegistry(IResourceRegistry resourceRegistry)
resourceRegistry
- public Connection open(String protocol, String name, int mode, boolean timeouts) throws IOException
ConnectionBase
open
in class ConnectionBase
protocol
- The URL protocolname
- The URL for the connectionmode
- The access modetimeouts
- A flag to indicate that the caller
wants timeout exceptions
IOException
- If some other kind of I/O error occurs.public void close() throws IOException
ConnectionBase
close
in interface Connection
close
in class ConnectionBase
IOException
- If an I/O error occurspublic void setTimeout(long timeout)
setTimeout
in interface ITimeoutableConnection
timeout
- Timeout period in milliseconds. Set this to 0 to turn off
timeouts (infinite wait), or to > 0 to wait that long
for data before throwing a TimeoutException.public long getTimeout()
getTimeout
in interface ITimeoutableConnection
public InputStream openInputStream() throws IOException
ConnectionBase
openInputStream
in interface InputConnection
openInputStream
in class ConnectionBase
IOException
- If an I/O error occurspublic OutputStream openOutputStream() throws IOException
ConnectionBase
openOutputStream
in interface OutputConnection
openOutputStream
in class ConnectionBase
IOException
- If an I/O error occurs
|
SunSPOT API V4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |