Class PageOutputStream
java.lang.Object
java.io.OutputStream
jakarta.servlet.ServletOutputStream
com.opensymphony.module.sitemesh.filter.PageOutputStream
- All Implemented Interfaces:
OutputBuffer,Closeable,Flushable,AutoCloseable
Implementation of ServletOutputStream that stores all data written
to it in a temporary buffer accessible from
getBuffer(java.lang.String) .- Version:
- $Revision: 1.4 $
- Author:
- Scott Farquhar, Hani Suleiman
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteArrayOutputStreamprivate static final Stringprivate static final booleanprivate final jakarta.servlet.ServletResponseThe reason we use a response, rather than just getting the outputstream directly is that under Tomcat, when serving static resources, we need to avoid calling getOutputStream() if we are going to use a decorator.private OutputStream -
Constructor Summary
ConstructorsConstructorDescriptionPageOutputStream(jakarta.servlet.ServletResponse response) Construct an OutputStream that will buffer the content written to it. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidflush()char[]get14Buffer(String encoding) char[]booleanisReady()voidsetWriteListener(jakarta.servlet.WriteListener writeListenerIn) private static char[]trim(char[] ca, int len) voidwrite(int b) Methods inherited from class jakarta.servlet.ServletOutputStream
close, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, writeMethods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Field Details
-
buffer
-
target
-
DEFAULT_ENCODING
-
JDK14
private static final boolean JDK14 -
response
private final jakarta.servlet.ServletResponse responseThe reason we use a response, rather than just getting the outputstream directly is that under Tomcat, when serving static resources, we need to avoid calling getOutputStream() if we are going to use a decorator.More information: http://marc.theaimsgroup.com/?l=tomcat-userinvalid input: '&m'=107569601410973invalid input: '&w'=2, SIM-74, SIM-82
-
-
Constructor Details
-
PageOutputStream
public PageOutputStream(jakarta.servlet.ServletResponse response) Construct an OutputStream that will buffer the content written to it.
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
discardBuffer
public void discardBuffer()- Specified by:
discardBufferin interfaceOutputBuffer
-
get14Buffer
-
trim
private static char[] trim(char[] ca, int len) -
getBuffer
- Specified by:
getBufferin interfaceOutputBuffer- Parameters:
encoding- The encoding to use for decoding the buffer
-
flush
public void flush()- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceOutputBuffer- Overrides:
flushin classOutputStream
-
isReady
public boolean isReady()- Specified by:
isReadyin classjakarta.servlet.ServletOutputStream
-
setWriteListener
public void setWriteListener(jakarta.servlet.WriteListener writeListenerIn) - Specified by:
setWriteListenerin classjakarta.servlet.ServletOutputStream
-