An input stream, which limits its data size. This stream is used, if the content length is unknown.
@version $Id: LimitedInputStream.java 1454691 2013-03-09 12:15:54Z simonetripodi $
Wraps a {@link InputStream}, limiting the number of bytes which can be read. This code is from Guava's 14.0 source code, because there is no compatible way to use this functionality in both a Guava 11 environment and a Guava >14 environment.
An input stream, which limits its data size. This stream is used, if the content length is unknown.
@version $Id: LimitedInputStream.java 1456935 2013-03-15 12:47:29Z markt $
Wraps a {@link 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
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.