org.apache.xmlgraphics.util.io
public class SubInputStream extends java.io.FilterInputStream
This InputStream can be used to read chunks from a larger file of which the length is known in advance.
| Constructor and Description |
|---|
SubInputStream(java.io.InputStream in,
long maxLen)
Creates a new SubInputStream.
|
SubInputStream(java.io.InputStream in,
long maxLen,
boolean closeUnderlying)
Creates a new SubInputStream.
|
public SubInputStream(java.io.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(java.io.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.public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.FilterInputStreamjava.io.IOExceptionCopyright 1999-2008 The Apache Software Foundation. All Rights Reserved.