Package i2p.susi.util
Class LimitInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- i2p.susi.util.CountingInputStream
-
- i2p.susi.util.LimitInputStream
-
- All Implemented Interfaces:
ReadCounter,Closeable,AutoCloseable
public class LimitInputStream extends CountingInputStream
Limit total reads and skips to a specified maximum, then return EOF- Since:
- 0.9.34
-
-
Field Summary
-
Fields inherited from class i2p.susi.util.CountingInputStream
count
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description LimitInputStream(InputStream in, long max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()intread()intread(byte[] buf, int off, int len)longskip(long n)-
Methods inherited from class i2p.susi.util.CountingInputStream
getRead
-
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, reset
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
LimitInputStream
public LimitInputStream(InputStream in, long max)
- Parameters:
max- max number of bytes to read
-
-
Method Detail
-
available
public int available() throws IOException- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classCountingInputStream- Throws:
IOException
-
read
public int read() throws IOException- Overrides:
readin classCountingInputStream- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException- Overrides:
readin classCountingInputStream- Throws:
IOException
-
-