|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
com.sun.spot.io.j2me.memory.MemoryInputStream
public class MemoryInputStream
An InputStream that streams over the device memory. You should not
normally construct instance of this class directly, but instead, use the GCF
framework. See Protocol for more details.
| Constructor Summary | |
|---|---|
MemoryInputStream(int startAddress)
Construct an instance to read from a given memory address. |
|
| Method Summary | |
|---|---|
int |
available()
Returns the number of bytes available to be read from the 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. |
long |
skip(long x)
Skips over and discards n bytes of data from this input
stream. |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, read, read, reset |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryInputStream(int startAddress)
startAddress - -- the memory address at which to start reading| Method Detail |
|---|
public int read()
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.public void close()
InputStream The close method of InputStream does
nothing.
close in class InputStreampublic long skip(long x)
InputStreamn bytes of data from this input
stream. The skip method may, for a variety of reasons, end
up skipping over some smaller number of bytes, possibly 0.
This may result from any of a number of conditions; reaching end of file
before n bytes have been skipped is only one possibility.
The actual number of bytes skipped is returned. If n is
negative, no bytes are skipped.
The skip method of InputStream creates a
byte array and then repeatedly reads into it until n bytes
have been read or the end of the stream has been reached. Subclasses are
encouraged to provide a more efficient implementation of this method.
skip in class InputStreamx - the number of bytes to be skipped.
public int available()
available in class InputStream
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||