Class LimitedInputStream

java.lang.Object
java.io.InputStream
org.greenrobot.essentials.io.LimitedInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class LimitedInputStream extends InputStream
Wraps around an InputStream and limits the amount of bytes that can be read from it. Use it if you operate on an InputStream that consists of chunks of a know size, each to be processed using a buffered input stream (e.g. GZIPInputStream). Normal buffered input streams would read beyond the limit. The LimitedInputStream never closes the inside InputStream(close does nothing).