Package org.apache.xmlrpc.util
Class LimitedInputStream
java.lang.Object
java.io.InputStream
org.apache.xmlrpc.util.LimitedInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A filtering
InputStream
for proper handling of
the Content-Length
header: It guarantees to return
at most a given number of bytes.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLimitedInputStream
(InputStream pIn, int pAvailable) Creates a new instance, reading from the given input stream and returning at most the given number of bytes. -
Method Summary
Methods inherited from class java.io.InputStream
available, close, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
available
private long available -
markedAvailable
private long markedAvailable -
in
-
-
Constructor Details
-
LimitedInputStream
Creates a new instance, reading from the given input stream and returning at most the given number of bytes.- Parameters:
pIn
- Input stream being read.pAvailable
- Number of bytes available inpIn
.
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-