|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
com.sun.spot.ipv6.tcp.TCPInputStream
public class TCPInputStream
Helper class for "tcp:" connections. This class provides an InputStream over the data received from another Spot. It also provides a small set of accessors to get information about the quality of the link. You should NOT normally instantiate this class directly, but rather via the GCF framework: see the first reference below for more details.
TCPConnection| Constructor Summary | |
|---|---|
TCPInputStream(Socket s)
Construct a TCPInputStream, using the TCP socket provided. |
|
| Method Summary | |
|---|---|
int |
available()
Return the number of bytes available to be read from the stream without blocking. |
void |
close()
Closes this input stream. |
long |
getTimeout()
returns the time, in milliseconds, this connection will wait for data before throwing a timeout exception |
int |
read()
Reads the next byte of data from the input stream. |
void |
setTimeout(int time)
change the timeout associated with this input stream |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, read, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TCPInputStream(Socket s)
s - The socket to be used when reading input| Method Detail |
|---|
public int read()
throws IOException
InputStreamint in the range 0 to
255. If no byte is available because the end of the stream
has been reached, the value -1 is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.
A subclass must provide an implementation of this method.
read in class InputStream-1 if the end of the
stream is reached.
IOException - if an I/O error occurs.
public int available()
throws IOException
available in class InputStreamIOException
public void close()
throws IOException
close in class InputStreamIOExceptionpublic void setTimeout(int time)
time - time, in milliseconds, to wait for data on this input streampublic long getTimeout()
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||