| java.lang.Object java.io.InputStream java.io.FilterInputStream org.apache.commons.fileupload.util.LimitedInputStream
LimitedInputStream | abstract public class LimitedInputStream extends FilterInputStream implements Closeable(Code) | | An input stream, which limits its data size. This stream is
used, if the content length is unknown.
|
Method Summary | |
public void | close() Closes this input stream and releases any system resources
associated with the stream. | public boolean | isClosed() Returns, whether this stream is already closed. | abstract protected void | raiseError(long pSizeMax, long pCount) Called to indicate, that the input streams limit has
been exceeded. | public int | read() Reads the next byte of data from this input stream. | public int | read(byte[] b, int off, int len) Reads up to len bytes of data from this input stream
into an array of bytes. |
LimitedInputStream | public LimitedInputStream(InputStream pIn, long pSizeMax)(Code) | | Creates a new instance.
Parameters: pIn - The input stream, which shall be limited. Parameters: pSizeMax - The limit; no more than this number of bytesshall be returned by the source stream. |
isClosed | public boolean isClosed() throws IOException(Code) | | Returns, whether this stream is already closed.
True, if the stream is closed, otherwise false. throws: IOException - An I/O error occurred. |
raiseError | abstract protected void raiseError(long pSizeMax, long pCount) throws IOException(Code) | | Called to indicate, that the input streams limit has
been exceeded.
Parameters: pSizeMax - The input streams limit, in bytes. Parameters: pCount - The actual number of bytes. throws: IOException - The called method is expectedto raise an IOException. |
read | public int read() throws IOException(Code) | | Reads the next byte of data from this input stream. The value
byte is returned as an int in the range
0 to 255 . If no byte is available
because the end of the stream has been reached, the value
-1 is returned. This method blocks until input data
is available, the end of the stream is detected, or an exception
is thrown.
This method
simply performs in.read() and returns the result.
the next byte of data, or -1 if the end of thestream is reached. exception: IOException - if an I/O error occurs. See Also: java.io.FilterInputStream.in |
read | public int read(byte[] b, int off, int len) throws IOException(Code) | | Reads up to len bytes of data from this input stream
into an array of bytes. If len is not zero, the method
blocks until some input is available; otherwise, no
bytes are read and 0 is returned.
This method simply performs in.read(b, off, len)
and returns the result.
Parameters: b - the buffer into which the data is read. Parameters: off - The start offset in the destination arrayb . Parameters: len - the maximum number of bytes read. the total number of bytes read into the buffer, or-1 if there is no more data because the end ofthe stream has been reached. exception: NullPointerException - If b is null . exception: IndexOutOfBoundsException - If off is negative,len is negative, or len is greater thanb.length - off exception: IOException - if an I/O error occurs. See Also: java.io.FilterInputStream.in |
|
|