|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.io.InputStream
javax.servlet.ServletInputStream
com.oreilly.servlet.multipart.BufferedServletInputStream
public class BufferedServletInputStream
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.
| 构造方法摘要 | |
|---|---|
BufferedServletInputStream(javax.servlet.ServletInputStream in)
Creates a BufferedServletInputStream that wraps the provided
ServletInputStream. |
|
| 方法摘要 | |
|---|---|
int |
read()
Implement buffering on top of the read method of
the wrapped ServletInputStream. |
int |
read(byte[] b,
int off,
int len)
Implement buffering on top of the read method of
the wrapped ServletInputStream. |
int |
readLine(byte[] b,
int off,
int len)
Implement buffering on top of the readLine method of
the wrapped ServletInputStream. |
| 从类 java.io.InputStream 继承的方法 |
|---|
available, close, mark, markSupported, read, reset, skip |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public BufferedServletInputStream(javax.servlet.ServletInputStream in)
BufferedServletInputStream that wraps the provided
ServletInputStream.
in - a servlet input stream.| 方法详细信息 |
|---|
public int readLine(byte[] b,
int off,
int len)
throws IOException
readLine method of
the wrapped ServletInputStream.
javax.servlet.ServletInputStream 中的 readLineb - an array of bytes into which data is read.off - an integer specifying the character at which
this method begins reading.len - an integer specifying the maximum number of
bytes to read.
IOException - if an I/O error occurs.
public int read()
throws IOException
read method of
the wrapped ServletInputStream.
InputStream 中的 read-1 if the end of the
stream is reached.
IOException - if an I/O error occurs.
public int read(byte[] b,
int off,
int len)
throws IOException
read method of
the wrapped ServletInputStream.
InputStream 中的 readb - the buffer into which the data is read.off - the start offset of the data.len - the maximum number of bytes read.
-1 if there is no more data because the end
of the stream has been reached.
IOException - if an I/O error occurs.
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||