Package com.opensymphony.module.sitemesh
Class SitemeshBufferWriter
java.lang.Object
java.io.Writer
com.opensymphony.module.sitemesh.util.CharArrayWriter
com.opensymphony.module.sitemesh.SitemeshBufferWriter
- All Implemented Interfaces:
SitemeshWriter,Closeable,Flushable,Appendable,AutoCloseable
A char array writer that caches other sitemesh buffers written to it, so that it doesn't have to continually copy
them from buffer to buffer.
-
Field Summary
Fields inherited from class com.opensymphony.module.sitemesh.util.CharArrayWriter
buf, count -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new sitemesh buffer writer.SitemeshBufferWriter(int initialSize) Instantiates a new sitemesh buffer writer. -
Method Summary
Modifier and TypeMethodDescriptionGet the underlying buffer for the writer.booleanwriteSitemeshBufferFragment(SitemeshBufferFragment bufferFragment) Write a sitemesh buffer fragment to the writer.
-
Constructor Details
-
SitemeshBufferWriter
public SitemeshBufferWriter()Instantiates a new sitemesh buffer writer. -
SitemeshBufferWriter
public SitemeshBufferWriter(int initialSize) Instantiates a new sitemesh buffer writer.- Parameters:
initialSize- the initial size
-
-
Method Details
-
writeSitemeshBufferFragment
public boolean writeSitemeshBufferFragment(SitemeshBufferFragment bufferFragment) throws IOException Description copied from interface:SitemeshWriterWrite a sitemesh buffer fragment to the writer. This may not be written immediately, it may be stored and written later, when this buffer is written out to a writer.- Specified by:
writeSitemeshBufferFragmentin interfaceSitemeshWriter- Parameters:
bufferFragment- The buffer fragment to write- Returns:
- True if the buffer was written immediately, or false if it will be written later
- Throws:
IOException- If an IOException occurred
-
getSitemeshBuffer
Description copied from interface:SitemeshWriterGet the underlying buffer for the writer.- Specified by:
getSitemeshBufferin interfaceSitemeshWriter- Returns:
- The underlying buffer
-