public class LimitInputStream
extends java.io.FilterInputStream
implements java.nio.channels.Channel
InputStream up to specified max. length| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.atomic.AtomicBoolean |
open |
private long |
remaining |
| Constructor and Description |
|---|
LimitInputStream(java.io.InputStream in,
long length) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
boolean |
isOpen() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
private final java.util.concurrent.atomic.AtomicBoolean open
private long remaining
public boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.FilterInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channelclose in class java.io.FilterInputStreamjava.io.IOException