|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.sun.spot.io.j2me.radiostream.RadioOutputStream
public class RadioOutputStream
Helper class for "radiostream:" connections. This class provides an OutputStream to stream data to another Spot. You should NOT normally instantiate this class directly, but rather via the GCF framework: see the first reference below for more details.
RadiostreamConnection| Constructor Summary | |
|---|---|
RadioOutputStream(IRadiostreamProtocolManager dispatcher,
ConnectionID cid,
RadioPolicy initialPolicy,
IRadioPolicyManager radioPolicyManager)
Construct a RadioOutputStream |
|
| Method Summary | |
|---|---|
void |
close()
Closes this output stream and releases any system resources associated with this stream. |
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out. |
int |
getFlushThreshold()
Get the flush threshold for this stream. |
byte |
getLocalPort()
Answer the port number for this connection |
void |
setFlushThreshold(int ft)
Set the flush threshold for this stream. |
void |
setRadioPolicy(RadioPolicy selection)
Set the radio policy for this connection |
void |
write(int arg0)
Writes the specified byte to this output stream. |
| Methods inherited from class java.io.OutputStream |
|---|
write, write |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RadioOutputStream(IRadiostreamProtocolManager dispatcher,
ConnectionID cid,
RadioPolicy initialPolicy,
IRadioPolicyManager radioPolicyManager)
dispatcher - the PortBasedProtocolManager that will dispatch packetscid - the ConnectionID object to be usedradioPolicyManager - initialPolicy - | Method Detail |
|---|
public void write(int arg0)
throws NoAckException,
ChannelBusyException,
NoRouteException,
NoMeshLayerAckException
OutputStreamwrite is that one byte is written
to the output stream. The byte to be written is the eight
low-order bits of the argument b. The 24
high-order bits of b are ignored.
Subclasses of OutputStream must provide an
implementation for this method.
write in class OutputStreamarg0 - the byte.
NoAckException
ChannelBusyException
NoRouteException
NoMeshLayerAckException
public void flush()
throws NoAckException,
ChannelBusyException,
NoRouteException,
NoMeshLayerAckException
OutputStreamflush is
that calling it is an indication that, if any bytes previously
written have been buffered by the implementation of the output
stream, such bytes should immediately be written to their
intended destination.
The flush method of OutputStream does nothing.
flush in class OutputStreamNoAckException
ChannelBusyException
NoRouteException
NoMeshLayerAckException
public void close()
throws IOException
OutputStreamclose
is that it closes the output stream. A closed stream cannot perform
output operations and cannot be reopened.
The close method of OutputStream does nothing.
close in class OutputStreamIOException - if an I/O error occurs.public int getFlushThreshold()
public void setFlushThreshold(int ft)
ft - - number of bytes to write to receiver before a radio packet is sent to the remote spot - should
be in the range 1 to (RadioPacket.getMaxMacPayloadSize()
- IRadiostreamProtocolManager.DATA_OFFSET)public void setRadioPolicy(RadioPolicy selection)
IRadioControl
setRadioPolicy in interface IRadioControlselection - the policy requiredpublic byte getLocalPort()
IRadioControl
getLocalPort in interface IRadioControl
|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||