|
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.InputStream com.sun.spot.peripheral.BoundedInputStream
public class BoundedInputStream
Wraps a parent InputStream
with an input stream on the assumptions
that the first four bytes of the parent's content are a Java int which tells us
how many more valid bytes remain in the parent.
Constructor Summary | |
---|---|
BoundedInputStream(InputStream in)
Construct an instance based on the supplied parent InputStream . |
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
int |
read()
Reads the next byte of data from the 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 BoundedInputStream(InputStream in) throws IOException
InputStream
.
in
- the parent input stream (see class comment)
IOException
Method Detail |
---|
public int read() throws IOException
InputStream
int
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 void close() throws IOException
InputStream
The close
method of InputStream
does
nothing.
close
in class InputStream
IOException
- if an I/O error occurs.public int available() throws IOException
InputStream
The available
method for class InputStream
always returns 0
.
This method should be overridden by subclasses.
available
in class InputStream
IOException
- if an I/O error occurs.
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |