Package org.apache.coyote.http11.upgrade
Class UpgradeServletOutputStream
- java.lang.Object
- 
- java.io.OutputStream
- 
- javax.servlet.ServletOutputStream
- 
- org.apache.coyote.http11.upgrade.UpgradeServletOutputStream
 
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.AutoCloseable
 
 public class UpgradeServletOutputStream extends ServletOutputStream 
- 
- 
Constructor SummaryConstructors Constructor Description UpgradeServletOutputStream(UpgradeProcessorBase processor, SocketWrapperBase<?> socketWrapper, UpgradeInfo upgradeInfo)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()booleanisReady()Checks if a non-blocking write will succeed.voidsetWriteListener(WriteListener listener)Sets theWriteListenerfor thisServletOutputStreamand thereby switches to non-blocking IO.voidwrite(byte[] b, int off, int len)voidwrite(int b)
 
- 
- 
- 
Constructor Detail- 
UpgradeServletOutputStreampublic UpgradeServletOutputStream(UpgradeProcessorBase processor, SocketWrapperBase<?> socketWrapper, UpgradeInfo upgradeInfo) 
 
- 
 - 
Method Detail- 
isReadypublic final boolean isReady() Description copied from class:javax.servlet.ServletOutputStreamChecks if a non-blocking write will succeed. If this returnsfalse, it will cause a callback toWriteListener.onWritePossible()when the buffer has emptied. If this method returnsfalseno further data must be written until the container callsWriteListener.onWritePossible().- Specified by:
- isReadyin class- ServletOutputStream
- Returns:
- trueif data can be written, else- false
 
 - 
setWriteListenerpublic final void setWriteListener(WriteListener listener) Description copied from class:javax.servlet.ServletOutputStreamSets theWriteListenerfor thisServletOutputStreamand 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:
- setWriteListenerin class- ServletOutputStream
- Parameters:
- listener- The non-blocking IO write listener
 
 - 
writepublic void write(int b) throws java.io.IOException- Specified by:
- writein class- java.io.OutputStream
- Throws:
- java.io.IOException
 
 - 
writepublic void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
- writein class- java.io.OutputStream
- Throws:
- java.io.IOException
 
 - 
flushpublic void flush() throws java.io.IOException- Specified by:
- flushin interface- java.io.Flushable
- Overrides:
- flushin class- java.io.OutputStream
- 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.OutputStream
- Throws:
- java.io.IOException
 
 
- 
 
-