public abstract class ServletInputStream extends InputStream
readLinemethod for reading data one line at a time. With some protocols, such as HTTP POST and PUT, a
ServletInputStreamobject can be used to read data sent from the client.
ServletInputStream object is normally retrieved via the
This is an abstract class that a servlet container implements. Subclasses of this class must implement the
|Modifier||Constructor and Description|
Does nothing, because this is an abstract class.
|Modifier and Type||Method and Description|
Returns true when all the data from the stream has been read else it returns false.
Returns true if data can be read without blocking else returns false.
Reads the input stream, one line at a time.
available, close, mark, markSupported, read, read, read, reset, skip
public int readLine(byte b, int off, int len) throws IOException
This method returns -1 if it reaches the end of the input stream before reading the maximum number of bytes.
b- 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 input or output exception has occurred
public abstract boolean isFinished()
truewhen all data for this particular request has been read, otherwise returns
public abstract boolean isReady()
trueif data can be obtained without blocking, otherwise returns
public abstract void setReadListener(ReadListener readListener)
ServletInputStreamto invoke the provided
ReadListenerwhen it is possible to read
ReadListenerthat should be notified when it's possible to read.
IllegalStateException- if one of the following conditions is true
NullPointerException- if readListener is null
Copyright © 2021 JBoss by Red Hat. All rights reserved.