| javax.servlet.ServletInputStream com.oreilly.servlet.multipart.BufferedServletInputStream
BufferedServletInputStream | public class BufferedServletInputStream extends ServletInputStream (Code) | | A BufferedServletInputStream wraps a
ServletInputStream in order to provide input buffering and to
avoid calling the the readLine method of the wrapped
ServletInputStream .
This is necessary because some servlet containers rely on the default
implementation of the readLine method provided by the Servlet
API classes, which is very slow. Tomcat 3.2, Tomcat 3.1, the JSWDK 1.0 web
server and the JSDK2.1 web server are all known to need this class for
performance reasons.
Also, it may be used to work around a bug in the Servlet API 2.0
implementation of readLine which contains a bug that causes
ArrayIndexOutOfBoundsExceptions under certain conditions.
Apache JServ is known to suffer from this bug.
author: Geoff Soutter version: 1.1, 2001/05/21, removed block of commented out code version: 1.0, 2000/10/27, initial revision |
Method Summary | |
public int | read() Implement buffering on top of the read method of
the wrapped ServletInputStream . | public int | read(byte b, int off, int len) Implement buffering on top of the read method of
the wrapped ServletInputStream .
Parameters: b - the buffer into which the data is read. Parameters: off - the start offset of the data. Parameters: len - the maximum number of bytes read. | public int | readLine(byte b, int off, int len) Implement buffering 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. |
BufferedServletInputStream | public BufferedServletInputStream(ServletInputStream in)(Code) | | Creates a BufferedServletInputStream that wraps the provided
ServletInputStream .
Parameters: in - a servlet input stream. |
read | public int read() throws IOException(Code) | | Implement buffering 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 buffering on top of the read method of
the wrapped ServletInputStream .
Parameters: b - the buffer into which the data is read. Parameters: off - the start offset of the data. 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 endof the 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 buffering 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)
|
|
|