org.apache.jackrabbit.mk.util
Class BoundedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.jackrabbit.mk.util.BoundedInputStream
- All Implemented Interfaces:
- Closeable
public class BoundedInputStream
- extends FilterInputStream
Implementation of an InputStream that is bounded by a limit
and will return -1 on reads when this limit is exceeded.
|
Method Summary |
void |
close()
Close this input stream. |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedInputStream
public BoundedInputStream(InputStream in,
int limit)
- Create a new instance of this class.
- Parameters:
in - input streamlimit - limit
read
public int read()
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Close this input stream. Finishes reading any pending chunks until
the last chunk is received. Does not close the underlying input
stream.
- Specified by:
close in interface Closeable- Overrides:
close in class FilterInputStream
- Throws:
IOException- See Also:
FilterInputStream.close()
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.