|
xmlgraphics-commons 1.5rc1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.apache.xmlgraphics.util.io.SubInputStream
public class SubInputStream
This class is a FilterInputStream descendant that reads from an underlying InputStream up to a defined number of bytes or the end of the underlying stream. Closing this InputStream will not result in the underlying InputStream to be closed, too.
This InputStream can be used to read chunks from a larger file of which the length is known in advance.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
SubInputStream(InputStream in,
long maxLen)
Creates a new SubInputStream. |
|
SubInputStream(InputStream in,
long maxLen,
boolean closeUnderlying)
Creates a new SubInputStream. |
Method Summary | |
---|---|
void |
close()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
long |
skip(long n)
|
Methods inherited from class java.io.FilterInputStream |
---|
available, mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubInputStream(InputStream in, long maxLen, boolean closeUnderlying)
in
- the InputStream to read frommaxLen
- the maximum number of bytes to read from the underlying InputStream until
the end-of-file is signalled.closeUnderlying
- true if the underlying stream should be closed when the
close()
method is called.public SubInputStream(InputStream in, long maxLen)
in
- the InputStream to read frommaxLen
- the maximum number of bytes to read from the underlying InputStream until
the end-of-file is signalled.Method Detail |
---|
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
public long skip(long n) throws IOException
skip
in class FilterInputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class FilterInputStream
IOException
|
xmlgraphics-commons 1.5rc1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |