Package org.apache.coyote.http11.upgrade
Class UpgradeServletInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- javax.servlet.ServletInputStream
- 
- org.apache.coyote.http11.upgrade.UpgradeServletInputStream
 
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable
 
 public class UpgradeServletInputStream extends ServletInputStream 
- 
- 
Constructor SummaryConstructors Constructor Description UpgradeServletInputStream(UpgradeProcessorBase processor, SocketWrapperBase<?> socketWrapper, UpgradeInfo upgradeInfo)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisFinished()Has the end of this InputStream been reached?booleanisReady()Can data be read from this InputStream without blocking?intread()intread(byte[] b, int off, int len)intreadLine(byte[] b, int off, int len)Reads the input stream, one line at a time.voidsetReadListener(ReadListener listener)Sets theReadListenerfor thisServletInputStreamand thereby switches to non-blocking IO.
 
- 
- 
- 
Constructor Detail- 
UpgradeServletInputStreampublic UpgradeServletInputStream(UpgradeProcessorBase processor, SocketWrapperBase<?> socketWrapper, UpgradeInfo upgradeInfo) 
 
- 
 - 
Method Detail- 
isFinishedpublic final boolean isFinished() Description copied from class:javax.servlet.ServletInputStreamHas the end of this InputStream been reached?- Specified by:
- isFinishedin class- ServletInputStream
- Returns:
- trueif all the data has been read from the stream, else- false
 
 - 
isReadypublic final boolean isReady() Description copied from class:javax.servlet.ServletInputStreamCan data be read from this InputStream without blocking? Returns If this method is called and returns false, the container will invokeReadListener.onDataAvailable()when data is available.- Specified by:
- isReadyin class- ServletInputStream
- Returns:
- trueif data can be read without blocking, else- false
 
 - 
setReadListenerpublic final void setReadListener(ReadListener listener) Description copied from class:javax.servlet.ServletInputStreamSets theReadListenerfor thisServletInputStreamand thereby switches to non-blocking IO. It is only valid to switch to non-blocking IO within async processing or HTTP upgrade processing.- Specified by:
- setReadListenerin class- ServletInputStream
- Parameters:
- listener- The non-blocking IO read listener
 
 - 
readpublic final int read() throws java.io.IOException- Specified by:
- readin class- java.io.InputStream
- Throws:
- java.io.IOException
 
 - 
readLinepublic final int readLine(byte[] b, int off, int len) throws java.io.IOExceptionDescription copied from class:javax.servlet.ServletInputStreamReads the input stream, one line at a time. Starting at an offset, reads bytes into an array, until it reads a certain number of bytes or reaches a newline character, which it reads into the array as well.This method returns -1 if it reaches the end of the input stream before reading the maximum number of bytes. - Overrides:
- readLinein class- ServletInputStream
- Parameters:
- 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
- Returns:
- an integer specifying the actual number of bytes read, or -1 if the end of the stream is reached
- Throws:
- java.io.IOException- if an input or output exception has occurred
 
 - 
readpublic final int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
- readin class- java.io.InputStream
- Throws:
- java.io.IOException
 
 - 
closepublic void close() throws java.io.IOException- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- java.io.InputStream
- Throws:
- java.io.IOException
 
 
- 
 
-