|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
com.sun.cldc.io.ResourceInputStream
public class ResourceInputStream
Input stream class for accessing resource files in classpath.
| Field Summary | |
|---|---|
Object |
fileDecoder
|
| Constructor Summary | |
|---|---|
ResourceInputStream(Object decoder)
|
|
ResourceInputStream(String name)
Construct a resource input stream for accessing objects in the jar file. |
|
| Method Summary | |
|---|---|
int |
available()
Gets the number of bytes remaining to be read. |
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
void |
mark(int readlimit)
Remembers current position in ResourceInputStream so that subsequent call to reset will rewind the stream
to the saved position. |
boolean |
markSupported()
Indicates that this ResourceInputStream supports mark/reset functionality |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b,
int off,
int len)
Reads bytes into a byte array. |
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream. |
long |
skip(long n)
Skips over and discards n bytes of data from this input
stream. |
| Methods inherited from class java.io.InputStream |
|---|
read |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Object fileDecoder
| Constructor Detail |
|---|
public ResourceInputStream(String name)
throws IOException
name - the name of the resource in classpath to access. The
name must not have a leading '/'.
IOException - if an I/O error occurs.public ResourceInputStream(Object decoder)
| Method Detail |
|---|
public int read()
throws IOException
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 - if an I/O error occurs.
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - the buffer to read into.off - offset to start at in the buffer.len - number of bytes to read.
-1 if the end
of the stream is reached.
IOException - if an I/O error occurs.InputStream.read()
public void close()
throws IOException
InputStream The close method of InputStream does
nothing.
close in class InputStreamIOException - if an I/O error occurs.public void mark(int readlimit)
reset will rewind the stream
to the saved position.
mark in class InputStreamreadlimit - affects nothingInputStream.reset()
public void reset()
throws IOException
mark method was last called on this input stream.
reset in class InputStreamIOException - if this stream has not been markedInputStream.mark(int)public boolean markSupported()
markSupported in class InputStreamInputStream.mark(int),
InputStream.reset()
public long skip(long n)
throws IOException
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 InputStreamn - the number of bytes to be skipped.
IOException - if an I/O error occurs.
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||