Class ByteArrayServletOutputStream
java.lang.Object
java.io.OutputStream
jakarta.servlet.ServletOutputStream
org.apache.catalina.ssi.ByteArrayServletOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Class that extends ServletOutputStream, used as a wrapper from within
SsiInclude
- Author:
- Bip Thelin
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ByteArrayOutputStream
Our buffer to hold the stream. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isReady()
TODO SERVLET 3.1void
setWriteListener
(WriteListener listener) TODO SERVLET 3.1byte[]
void
write
(int b) Write to our buffer.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
close, flush, nullOutputStream, write, write
-
Field Details
-
buf
Our buffer to hold the stream.
-
-
Constructor Details
-
ByteArrayServletOutputStream
public ByteArrayServletOutputStream()Construct a new ServletOutputStream.
-
-
Method Details
-
toByteArray
public byte[] toByteArray()- Returns:
- the byte array.
-
write
public void write(int b) Write to our buffer.- Specified by:
write
in classOutputStream
- Parameters:
b
- The parameter to write
-
isReady
public boolean isReady()TODO SERVLET 3.1- Specified by:
isReady
in classServletOutputStream
- Returns:
true
if data can be written, elsefalse
-
setWriteListener
TODO SERVLET 3.1- Specified by:
setWriteListener
in classServletOutputStream
- Parameters:
listener
- The non-blocking IO write listener
-