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, 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:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-