|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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
OutputStream
write
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 OutputStream
arg0
- the byte
.
NoAckException
ChannelBusyException
NoRouteException
NoMeshLayerAckException
public void flush() throws NoAckException, ChannelBusyException, NoRouteException, NoMeshLayerAckException
OutputStream
flush
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 OutputStream
NoAckException
ChannelBusyException
NoRouteException
NoMeshLayerAckException
public void close() throws IOException
OutputStream
close
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 OutputStream
IOException
- 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 IRadioControl
selection
- the policy requiredpublic byte getLocalPort()
IRadioControl
getLocalPort
in interface IRadioControl
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |