Package org.apache.catalina.connector
Class CoyoteOutputStream
java.lang.Object
java.io.OutputStream
jakarta.servlet.ServletOutputStream
org.apache.catalina.connector.CoyoteOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Coyote implementation of the servlet output stream.
- Author:
- Costin Manolache, Remy Maucherat
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
clone()
Prevent cloning the facade.void
close()
void
flush()
Will send the buffer to the client.boolean
isReady()
Checks if a non-blocking write will succeed.void
setWriteListener
(WriteListener listener) Sets theWriteListener
for thisServletOutputStream
and thereby switches to non-blocking IO.void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int i) void
write
(ByteBuffer from) Methods inherited from class jakarta.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
sm
-
ob
-
-
Constructor Details
-
CoyoteOutputStream
-
-
Method Details
-
clone
Prevent cloning the facade.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Throws:
IOException
-
flush
Will send the buffer to the client.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
isReady
public boolean isReady()Description copied from class:jakarta.servlet.ServletOutputStream
Checks 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 returnsfalse
no further data must be written until the container callsWriteListener.onWritePossible()
.- Specified by:
isReady
in classServletOutputStream
- Returns:
true
if data can be written, elsefalse
-
setWriteListener
Description copied from class:jakarta.servlet.ServletOutputStream
Sets theWriteListener
for thisServletOutputStream
and 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:
setWriteListener
in classServletOutputStream
- Parameters:
listener
- The non-blocking IO write listener
-