| javax.servlet.ServletInputStream com.oreilly.servlet.multipart.LimitedServletInputStream
LimitedServletInputStream | public class LimitedServletInputStream extends ServletInputStream (Code) | | A LimitedServletInputStream wraps another
ServletInputStream in order to keep track of how many bytes
have been read and detect when the Content-Length limit has been reached.
This is necessary since some servlet containers are slow to notice the end
of stream and cause the client code to hang if it tries to read past it.
author: Jason Hunter author: Geoff Soutter version: 1.0, 2000/10/27, initial revision |
Method Summary | |
public int | read() Implement length limitation on top of the read method of
the wrapped ServletInputStream . | public int | read(byte b, int off, int len) Implement length limitation on top of the read method of
the wrapped ServletInputStream .
Parameters: b - destination buffer. Parameters: off - offset at which to start storing bytes. Parameters: len - maximum number of bytes to read. | public int | readLine(byte b, int off, int len) Implement length limitation on top of the readLine method of
the wrapped ServletInputStream .
Parameters: b - an array of bytes into which data is read. Parameters: off - an integer specifying the character at whichthis method begins reading. Parameters: len - an integer specifying the maximum number of bytes to read. |
LimitedServletInputStream | public LimitedServletInputStream(ServletInputStream in, int totalExpected)(Code) | | Creates a LimitedServletInputStream with the specified
length limit that wraps the provided ServletInputStream .
|
read | public int read() throws IOException(Code) | | Implement length limitation on top of the read method of
the wrapped ServletInputStream .
the next byte of data, or -1 if the end of thestream is reached. exception: IOException - if an I/O error occurs. |
read | public int read(byte b, int off, int len) throws IOException(Code) | | Implement length limitation on top of the read method of
the wrapped ServletInputStream .
Parameters: b - destination buffer. Parameters: off - offset at which to start storing bytes. Parameters: len - maximum number of bytes to read. the number of bytes read, or -1 if the end ofthe stream has been reached. exception: IOException - if an I/O error occurs. |
readLine | public int readLine(byte b, int off, int len) throws IOException(Code) | | Implement length limitation on top of the readLine method of
the wrapped ServletInputStream .
Parameters: b - an array of bytes into which data is read. Parameters: off - an integer specifying the character at whichthis method begins reading. Parameters: len - an integer specifying the maximum number of bytes to read. an integer specifying the actual number of bytes read, or -1 if the end of the stream is reached. exception: IOException - if an I/O error occurs. |
Methods inherited from javax.servlet.ServletInputStream | public int readLine(byte[] b, int off, int len) throws IOException(Code)(Java Doc)
|
|
|