ReadCounter
, Closeable
, AutoCloseable
public class LimitInputStream extends CountingInputStream
count
in
Constructor | Description |
---|---|
LimitInputStream(InputStream in,
long max) |
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
|
int |
read() |
|
int |
read(byte[] buf,
int off,
int len) |
|
long |
skip(long n) |
getRead
close, mark, markSupported, read, reset
readAllBytes, readNBytes, transferTo
public LimitInputStream(InputStream in, long max)
max
- max number of bytes to readpublic int available() throws IOException
available
in class FilterInputStream
IOException
public long skip(long n) throws IOException
skip
in class CountingInputStream
IOException
public int read() throws IOException
read
in class CountingInputStream
IOException
public int read(byte[] buf, int off, int len) throws IOException
read
in class CountingInputStream
IOException