Name
ServletInputStream
Synopsis
ServletInputStream
provides an input stream for reading data from a client request. A servlet can get a ServletInputStream
by calling the getInputStream()
method of ServletRequest
. While ServletInputStream
does contain a readLine()
method for reading textual data one line at a time, this functionality was taken over by BufferedReader
objects and the getReader()
method of ServletRequest
in version 2.0 of the Servlet API. Thus, ServletInputStream
should only be used to read binary data, generally in the context of a filtering servlet.
public abstract class ServletInputStream extends java.io.InputStream { // Protected Constructors protected ServletInputStream(); // Public Instance Methods public int readLine(byte[] b, int off, int len) throws IOException; }
Passed To
javax.servlet.http.HttpUtils.parsePostData()
Returned By
ServletRequest.getInputStream()
, ServletRequestWrapper.getInputStream()
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.