public class SubInputStream extends FilterInputStream
This InputStream can be used to read chunks from a larger file of which the length is known in advance.
in
构造器和说明 |
---|
SubInputStream(InputStream in,
long maxLen)
Creates a new SubInputStream.
|
SubInputStream(InputStream in,
long maxLen,
boolean closeUnderlying)
Creates a new SubInputStream.
|
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.public int read() throws IOException
read
在类中 FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
在类中 FilterInputStream
IOException
public long skip(long n) throws IOException
skip
在类中 FilterInputStream
IOException
public void close() throws IOException
close
在接口中 Closeable
close
在接口中 AutoCloseable
close
在类中 FilterInputStream
IOException
Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.