| java.lang.Object java.io.Writer org.apache.velocity.io.VelocityWriter
VelocityWriter | final public class VelocityWriter extends Writer (Code) | | Implementation of a fast Writer. It was originally taken from JspWriter
and modified to have less syncronization going on.
author: Jason van Zyl author: Jon S. Stevens author: Anil K. Vijendran version: $Id: VelocityWriter.java 463298 2006-10-12 16:10:32Z henning $ |
Constructor Summary | |
public | VelocityWriter(Writer writer) Create a buffered character-output stream that uses a default-sized
output buffer. | public | VelocityWriter(Writer writer, int sz, boolean autoFlush) Create a new buffered character-output stream that uses an output
buffer of the given size. |
Method Summary | |
final public void | clear() Discard the output buffer. | final public void | close() Close the stream. | final public void | flush() Flush the stream. | public int | getBufferSize() This method returns the size of the buffer used by the JspWriter. | final public int | getRemaining() | public boolean | isAutoFlush() This method indicates whether the JspWriter is autoFlushing. | final public void | recycle(Writer writer) | final public void | write(int c) Write a single character. | final public void | write(char cbuf, int off, int len) Write a portion of an array of characters.
Ordinarily this method stores characters from the given array into
this stream's buffer, flushing the buffer to the underlying stream as
needed. | final public void | write(char buf) Write an array of characters. | final public void | write(String s, int off, int len) Write a portion of a String. | final public void | write(String s) Write a string. |
DEFAULT_BUFFER | final public static int DEFAULT_BUFFER(Code) | | constant indicating that the Writer is buffered and is using the
implementation default buffer size
|
NO_BUFFER | final public static int NO_BUFFER(Code) | | constant indicating that the Writer is not buffering output
|
UNBOUNDED_BUFFER | final public static int UNBOUNDED_BUFFER(Code) | | constant indicating that the Writer is buffered and is unbounded;
this is used in BodyContent
|
VelocityWriter | public VelocityWriter(Writer writer)(Code) | | Create a buffered character-output stream that uses a default-sized
output buffer.
Parameters: writer - Writer to wrap around |
VelocityWriter | public VelocityWriter(Writer writer, int sz, boolean autoFlush)(Code) | | Create a new buffered character-output stream that uses an output
buffer of the given size.
Parameters: writer - Writer to wrap around Parameters: sz - Output-buffer size, a positive integer Parameters: autoFlush - exception: IllegalArgumentException - If sz is <= 0 |
clear | final public void clear()(Code) | | Discard the output buffer.
|
getBufferSize | public int getBufferSize()(Code) | | This method returns the size of the buffer used by the JspWriter.
the size of the buffer in bytes, or 0 is unbuffered. |
getRemaining | final public int getRemaining()(Code) | | the number of bytes unused in the buffer |
isAutoFlush | public boolean isAutoFlush()(Code) | | This method indicates whether the JspWriter is autoFlushing.
if this JspWriter is auto flushing or throwing IOExceptions onbuffer overflow conditions |
recycle | final public void recycle(Writer writer)(Code) | | resets this class so that it can be reused
Parameters: writer - |
write | final public void write(char cbuf, int off, int len) throws IOException(Code) | | Write a portion of an array of characters.
Ordinarily this method stores characters from the given array into
this stream's buffer, flushing the buffer to the underlying stream as
needed. If the requested length is at least as large as the buffer,
however, then this method will flush the buffer and write the characters
directly to the underlying stream. Thus redundant
DiscardableBufferedWriter s will not copy data unnecessarily.
Parameters: cbuf - A character array Parameters: off - Offset from which to start reading characters Parameters: len - Number of characters to write throws: IOException - |
write | final public void write(char buf) throws IOException(Code) | | Write an array of characters. This method cannot be inherited from the
Writer class because it must suppress I/O exceptions.
Parameters: buf - throws: IOException - |
write | final public void write(String s, int off, int len) throws IOException(Code) | | Write a portion of a String.
Parameters: s - String to be written Parameters: off - Offset from which to start reading characters Parameters: len - Number of characters to be written throws: IOException - |
write | final public void write(String s) throws IOException(Code) | | Write a string. This method cannot be inherited from the Writer class
because it must suppress I/O exceptions.
Parameters: s - throws: IOException - |
|
|