Class LimitedInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.eclipse.jgit.util.io.LimitedInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public abstract class LimitedInputStream extends FilterInputStream
Wraps a InputStream, limiting the number of bytes which can be read. This class was copied and modifed from the Google Guava 16.0. Differently from the original Guava code, when a caller tries to read from this stream past the given limit and the wrapped stream hasn't yet reached its EOF this class will call the limitExceeded method instead of returning EOF.
Since:
3.3