|
SunSPOT API V3.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.remoteprint.Protocol
public class Protocol
Implementor of RemotePrintConnection
using the Generic Connection Framework (GCF)
used by J2ME.
We want each newline ('\n') to automatically flush the buffer and send the line over the radio connection to the remote print server to be displayed. We cannot just use a Radio stream directly since it does not autoflush. So we use a RemotePrintOutputStream and connect it to a RadioOutputStream.
RemotePrintConnection
Constructor Summary | |
---|---|
Protocol()
|
Method Summary | |
---|---|
void |
close()
Close this remoteprint connection. |
Connection |
open(String protocolName,
String name,
int mode,
boolean timeouts)
Open a new "remoteprint" connection to the specified SPOT. |
InputStream |
openInputStream()
Open an InputStream for this connection. |
OutputStream |
openOutputStream()
Open an OutputStream for 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 Connection open(String protocolName, String name, int mode, boolean timeouts)
Note: the actual "radio" stream connection is opened by RemotePrintOutputStream.
open
in class ConnectionBase
protocolName
- = "remoteprint:"name
- the IEEE radio address of the SPOT to connect to and the port to use
for the connection, e.g. "123456:119"mode
- the access mode (ignored)timeouts
- a flag to indicate that the caller wants timeout exceptions (ignored)
ConnectionBase.open(java.lang.String, java.lang.String, int, boolean)
public void close() throws IOException
Note: this does not close the radio stream used by the remote printing.
close
in interface Connection
close
in class ConnectionBase
IOException
- If an I/O error occursConnection.close()
public InputStream openInputStream()
Note: remoteprint connections do not support an InputStream.
openInputStream
in interface InputConnection
openInputStream
in class ConnectionBase
ConnectionBase.openInputStream()
public OutputStream openOutputStream()
Note: all "remoteprint" connections from this SPOT to the remote print server will share the same OutputStream.
openOutputStream
in interface OutputConnection
openOutputStream
in class ConnectionBase
ConnectionBase.openOutputStream()
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |