|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Writer
freemarker.ext.util.TemplateBufferedWriter
public final class TemplateBufferedWriter
Implements a simple, non-synchronized character buffer as a Writer.
Since FM-Classic's write methods are all synchronous, we can get
away with unsynchronized calls. Sychronization of the underlying
Writer is left to the wrapped Writer itself.
| Field Summary |
|---|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
TemplateBufferedWriter(java.io.Writer parentWriter)
Constructor that takes a Writer as a destination for
the buffered output. |
|
TemplateBufferedWriter(java.io.Writer parentWriter,
int bufferSize)
Constructor that takes a Writer as a destination for
the buffered output, along with a size of the buffer to be used. |
|
| Method Summary | |
|---|---|
void |
close()
Close the stream, flushing it first. |
void |
flush()
Flush the stream. |
void |
flushBuffer()
Flush the buffer. |
void |
write(char[] cbuf)
Write an array of characters. |
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(java.lang.String str)
Write a string. |
void |
write(java.lang.String str,
int off,
int len)
Write a portion of a string. |
| Methods inherited from class java.io.Writer |
|---|
append, append, append |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemplateBufferedWriter(java.io.Writer parentWriter)
Writer as a destination for
the buffered output.
parentWriter - the Writer that the buffered content should be
written to
public TemplateBufferedWriter(java.io.Writer parentWriter,
int bufferSize)
Writer as a destination for
the buffered output, along with a size of the buffer to be used.
parentWriter - the Writer to which the buffered content should be
writtenbufferSize - the size of the buffer| Method Detail |
|---|
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writercbuf - Array of charactersoff - Offset from which to start writing characterslen - Number of characters to write
java.io.IOException - If an I/O error occurs
public void write(int c)
throws java.io.IOException
write in class java.io.Writerc - int specifying a character to be written.
java.io.IOException - If an I/O error occurs
public void write(char[] cbuf)
throws java.io.IOException
write in class java.io.Writercbuf - Array of characters to be written
java.io.IOException - If an I/O error occurs
public void write(java.lang.String str)
throws java.io.IOException
write in class java.io.Writerstr - String to be written
java.io.IOException - If an I/O error occurs
public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerstr - A Stringoff - Offset from which to start writing characterslen - Number of characters to write
java.io.IOException - If an I/O error occurs
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException - If an I/O error occurs
public void flushBuffer()
throws java.io.IOException
java.io.IOException - If an I/O error occurs
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.Writerjava.io.IOException - If an I/O error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||