Module cloud.piranha.core.impl
Package cloud.piranha.core.impl
Class DefaultWebApplicationOutputStream
java.lang.Object
java.io.OutputStream
jakarta.servlet.ServletOutputStream
cloud.piranha.core.api.WebApplicationOutputStream
cloud.piranha.core.impl.DefaultWebApplicationOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
The default WebApplicationOutputStream.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
Stores the buffer.protected int
Stores the index.protected OutputStream
Stores the output stream.protected WebApplicationResponse
Stores the web application response. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
void
Flush the buffer.int
Get the buffer size.Get the output stream.Get the web application response.boolean
isReady()
void
Reset the buffer.void
setBufferSize
(int bufferSize) Set the buffer size.void
setOutputStream
(OutputStream outputStream) Set the output stream.void
setResponse
(WebApplicationResponse response) Set the web application response.void
setWriteListener
(jakarta.servlet.WriteListener listener) void
write
(int integer) 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, write, write
-
Field Details
-
buffer
protected byte[] bufferStores the buffer. -
index
protected int indexStores the index. -
response
Stores the web application response. -
outputStream
Stores the output stream.
-
-
Constructor Details
-
DefaultWebApplicationOutputStream
public DefaultWebApplicationOutputStream()Constructor.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
flushBuffer
Flush the buffer.This will cause the following to be written out in order:
- the status line
- the response headers
- the buffer (aka the response body)
- Specified by:
flushBuffer
in classWebApplicationOutputStream
- Throws:
IOException
- when an I/O error occurs.
-
getBufferSize
public int getBufferSize()Description copied from class:WebApplicationOutputStream
Get the buffer size.- Specified by:
getBufferSize
in classWebApplicationOutputStream
- Returns:
- the buffer size.
-
getOutputStream
Description copied from class:WebApplicationOutputStream
Get the output stream.- Specified by:
getOutputStream
in classWebApplicationOutputStream
- Returns:
- the output stream.
-
getResponse
Description copied from class:WebApplicationOutputStream
Get the web application response.- Specified by:
getResponse
in classWebApplicationOutputStream
- Returns:
- the web application response.
-
isReady
public boolean isReady()- Specified by:
isReady
in classjakarta.servlet.ServletOutputStream
-
resetBuffer
public void resetBuffer()Description copied from class:WebApplicationOutputStream
Reset the buffer.- Specified by:
resetBuffer
in classWebApplicationOutputStream
-
setBufferSize
public void setBufferSize(int bufferSize) Description copied from class:WebApplicationOutputStream
Set the buffer size.- Specified by:
setBufferSize
in classWebApplicationOutputStream
- Parameters:
bufferSize
- the buffer size.
-
setOutputStream
Description copied from class:WebApplicationOutputStream
Set the output stream.- Specified by:
setOutputStream
in classWebApplicationOutputStream
- Parameters:
outputStream
- the output stream.
-
setResponse
Description copied from class:WebApplicationOutputStream
Set the web application response.- Specified by:
setResponse
in classWebApplicationOutputStream
- Parameters:
response
- the web application response.
-
setWriteListener
public void setWriteListener(jakarta.servlet.WriteListener listener) - Specified by:
setWriteListener
in classjakarta.servlet.ServletOutputStream
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-