public class LimitInputStream extends java.io.FilterInputStream implements Limit
Modifier and Type | Field and Description |
---|---|
protected boolean |
limitInPlace |
protected int |
remainingBytes |
Constructor and Description |
---|
LimitInputStream(java.io.InputStream in)
Construct a LimitInputStream and call the clearLimit() method.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
clearLimit()
Clear any limit set by setLimit.
|
boolean |
markSupported()
This stream doesn't support mark/reset, independent of whether the
underlying stream does so or not.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
setInput(java.io.InputStream in) |
void |
setLimit(int length)
Set the limit of the stream that can be read.
|
long |
skip(long count) |
protected int remainingBytes
protected boolean limitInPlace
public LimitInputStream(java.io.InputStream in)
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public long skip(long count) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.FilterInputStream
java.io.IOException
public void setLimit(int length)
public int clearLimit()
clearLimit
in interface Limit
public void setInput(java.io.InputStream in)
public boolean markSupported()
The reason for not supporting mark/reset, is that it is hard to combine with the limit functionality without always keeping track of the number of bytes read.
markSupported
in class java.io.FilterInputStream
false
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.