@InterfaceAudience.Private public class BoundedDelegatingInputStream extends DelegatingInputStream
| Modifier and Type | Field and Description |
|---|---|
protected long |
limit |
protected long |
pos |
in| Constructor and Description |
|---|
BoundedDelegatingInputStream(InputStream in,
long limit) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
int |
read()
Call the delegate's
read() method if the current position is less than the limit. |
int |
read(byte[] b,
int off,
int len)
Call the delegate's
read(byte[], int, int) method if the current position is less than
the limit. |
void |
setDelegate(InputStream in,
long limit) |
long |
skip(long len)
Call the delegate's
skip(long) method. |
getDelegate, setDelegateclose, mark, markSupported, read, resetpublic BoundedDelegatingInputStream(InputStream in, long limit)
public void setDelegate(InputStream in, long limit)
public int read() throws IOException
read() method if the current position is less than the limit.read in class FilterInputStreamIOExceptionpublic int read(byte[] b, int off, int len) throws IOException
read(byte[], int, int) method if the current position is less than
the limit.read in class FilterInputStreamb - read bufferoff - Start offsetlen - The number of bytes to readIOExceptionpublic long skip(long len) throws IOException
skip(long) method.skip in class FilterInputStreamlen - the number of bytes to skipIOExceptionpublic int available() throws IOException
available in class FilterInputStreamIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.