|
Sun SPOT API |
||||||||
| 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.radio.RadioOutputStream
public class RadioOutputStream
Helper class for "radio:" 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.
RadioConnection| Constructor Summary | |
|---|---|
RadioOutputStream(IPortBasedProtocolManager dispatcher,
ConnectionID cid)
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. |
void |
setFlushThreshold(int ft)
Set the flush threshold for this stream. |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RadioOutputStream(IPortBasedProtocolManager dispatcher,
ConnectionID cid)
dispatcher - the PortBasedProtocolManager that will dispatch packetscid - the ConnectionID object to be used| Method Detail |
|---|
public void write(int arg0)
throws NoAckException,
ChannelBusyException
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
public void flush()
throws NoAckException,
ChannelBusyException
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
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()
- IPortBasedProtocolManager.DATA_OFFSET)
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||