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 int
available()
int
read()
int
read(byte[] buf, int off, int len)
long
skip(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:
available
in classFilterInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classCountingInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Overrides:
read
in classCountingInputStream
- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException
- Overrides:
read
in classCountingInputStream
- Throws:
IOException
-
-