Package io.inversion.utils
Class LimitInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- io.inversion.utils.LimitInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class LimitInputStream extends java.io.FilterInputStreamAn InputStream that limits the number of bytes which can be read.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description LimitInputStream(java.io.InputStream in, long limit, boolean exact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmarkSupported()intread()intread(byte[] b, int off, int len)voidreset()longskip(long n)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-