blob: 600cdef9ad9804f8cc3c2e38063149f2e81fe485 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Apr 14 08:26:32 EDT 2004 -->
<TITLE>
Velocity 1.4 API: Class VelocityWriter
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VelocityWriter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="VelocityWriter.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.velocity.io</FONT>
<BR>
Class VelocityWriter</H2>
<PRE>
java.lang.Object
|
+--java.io.Writer
|
+--<B>org.apache.velocity.io.VelocityWriter</B>
</PRE>
<HR>
<DL>
<DT>public final class <B>VelocityWriter</B><DT>extends java.io.Writer</DL>
<P>
Implementation of a fast Writer. It was originally taken from JspWriter
and modified to have less syncronization going on.
<P>
<DL>
<DT><B>Version: </B><DD>$Id: VelocityWriter.java,v 1.8.4.1 2004/03/03 23:22:54 geirm Exp $</DD>
<DT><B>Author: </B><DD><a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>, <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>, Anil K. Vijendran</DD>
</DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#autoFlush">autoFlush</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#bufferSize">bufferSize</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;char[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#cb">cb</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#DEFAULT_BUFFER">DEFAULT_BUFFER</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constant indicating that the Writer is buffered and is using the
implementation default buffer size</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#defaultCharBufferSize">defaultCharBufferSize</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#flushed">flushed</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#nextChar">nextChar</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#NO_BUFFER">NO_BUFFER</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constant indicating that the Writer is not buffering output</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#UNBOUNDED_BUFFER">UNBOUNDED_BUFFER</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constant indicating that the Writer is buffered and is unbounded;
this is used in BodyContent</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.io.Writer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#writer">writer</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_java.io.Writer"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class java.io.Writer</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>lock, writeBuffer, writeBufferSize</CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#VelocityWriter(int, boolean)">VelocityWriter</A></B>(int&nbsp;bufferSize,
boolean&nbsp;autoFlush)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#VelocityWriter(java.io.Writer)">VelocityWriter</A></B>(java.io.Writer&nbsp;writer)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a buffered character-output stream that uses a default-sized
output buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#VelocityWriter(java.io.Writer, int, boolean)">VelocityWriter</A></B>(java.io.Writer&nbsp;writer,
int&nbsp;sz,
boolean&nbsp;autoFlush)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new buffered character-output stream that uses an output
buffer of the given size.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#bufferOverflow()">bufferOverflow</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#clear()">clear</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Discard the output buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#close()">close</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close the stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#flush()">flush</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flush the stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#flushBuffer()">flushBuffer</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flush the output buffer to the underlying character stream, without
flushing the stream itself.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#getBufferSize()">getBufferSize</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method returns the size of the buffer used by the JspWriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#getRemaining()">getRemaining</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#init(java.io.Writer, int, boolean)">init</A></B>(java.io.Writer&nbsp;writer,
int&nbsp;sz,
boolean&nbsp;autoFlush)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#isAutoFlush()">isAutoFlush</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method indicates whether the JspWriter is autoFlushing.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#min(int, int)">min</A></B>(int&nbsp;a,
int&nbsp;b)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Our own little min method, to avoid loading
<code>java.lang.Math</code> if we've run out of file
descriptors and we're trying to print a stack trace.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#recycle(java.io.Writer)">recycle</A></B>(java.io.Writer&nbsp;writer)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resets this class so that it can be reused</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#write(char[])">write</A></B>(char[]&nbsp;buf)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write an array of characters.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#write(char[], int, int)">write</A></B>(char[]&nbsp;cbuf,
int&nbsp;off,
int&nbsp;len)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write a portion of an array of characters.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#write(int)">write</A></B>(int&nbsp;c)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write a single character.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#write(java.lang.String)">write</A></B>(java.lang.String&nbsp;s)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write a string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/velocity/io/VelocityWriter.html#write(java.lang.String, int, int)">write</A></B>(java.lang.String&nbsp;s,
int&nbsp;off,
int&nbsp;len)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write a portion of a String.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="NO_BUFFER"><!-- --></A><H3>
NO_BUFFER</H3>
<PRE>
public static final int <B>NO_BUFFER</B></PRE>
<DL>
<DD>constant indicating that the Writer is not buffering output</DL>
<HR>
<A NAME="DEFAULT_BUFFER"><!-- --></A><H3>
DEFAULT_BUFFER</H3>
<PRE>
public static final int <B>DEFAULT_BUFFER</B></PRE>
<DL>
<DD>constant indicating that the Writer is buffered and is using the
implementation default buffer size</DL>
<HR>
<A NAME="UNBOUNDED_BUFFER"><!-- --></A><H3>
UNBOUNDED_BUFFER</H3>
<PRE>
public static final int <B>UNBOUNDED_BUFFER</B></PRE>
<DL>
<DD>constant indicating that the Writer is buffered and is unbounded;
this is used in BodyContent</DL>
<HR>
<A NAME="bufferSize"><!-- --></A><H3>
bufferSize</H3>
<PRE>
protected int <B>bufferSize</B></PRE>
<DL>
</DL>
<HR>
<A NAME="autoFlush"><!-- --></A><H3>
autoFlush</H3>
<PRE>
protected boolean <B>autoFlush</B></PRE>
<DL>
</DL>
<HR>
<A NAME="writer"><!-- --></A><H3>
writer</H3>
<PRE>
private java.io.Writer <B>writer</B></PRE>
<DL>
</DL>
<HR>
<A NAME="cb"><!-- --></A><H3>
cb</H3>
<PRE>
private char[] <B>cb</B></PRE>
<DL>
</DL>
<HR>
<A NAME="nextChar"><!-- --></A><H3>
nextChar</H3>
<PRE>
private int <B>nextChar</B></PRE>
<DL>
</DL>
<HR>
<A NAME="defaultCharBufferSize"><!-- --></A><H3>
defaultCharBufferSize</H3>
<PRE>
private static int <B>defaultCharBufferSize</B></PRE>
<DL>
</DL>
<HR>
<A NAME="flushed"><!-- --></A><H3>
flushed</H3>
<PRE>
private boolean <B>flushed</B></PRE>
<DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="VelocityWriter(java.io.Writer)"><!-- --></A><H3>
VelocityWriter</H3>
<PRE>
public <B>VelocityWriter</B>(java.io.Writer&nbsp;writer)</PRE>
<DL>
<DD>Create a buffered character-output stream that uses a default-sized
output buffer.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>response</CODE> - A Servlet Response</DL>
</DD>
</DL>
<HR>
<A NAME="VelocityWriter(int, boolean)"><!-- --></A><H3>
VelocityWriter</H3>
<PRE>
private <B>VelocityWriter</B>(int&nbsp;bufferSize,
boolean&nbsp;autoFlush)</PRE>
<DL>
<DD>private constructor.</DL>
<HR>
<A NAME="VelocityWriter(java.io.Writer, int, boolean)"><!-- --></A><H3>
VelocityWriter</H3>
<PRE>
public <B>VelocityWriter</B>(java.io.Writer&nbsp;writer,
int&nbsp;sz,
boolean&nbsp;autoFlush)</PRE>
<DL>
<DD>Create a new buffered character-output stream that uses an output
buffer of the given size.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>response</CODE> - A Servlet Response<DD><CODE>sz</CODE> - Output-buffer size, a positive integer<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - If sz is <= 0</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getBufferSize()"><!-- --></A><H3>
getBufferSize</H3>
<PRE>
public int <B>getBufferSize</B>()</PRE>
<DL>
<DD>This method returns the size of the buffer used by the JspWriter.<DD><DL>
<DT><B>Returns:</B><DD>the size of the buffer in bytes, or 0 is unbuffered.</DL>
</DD>
</DL>
<HR>
<A NAME="isAutoFlush()"><!-- --></A><H3>
isAutoFlush</H3>
<PRE>
public boolean <B>isAutoFlush</B>()</PRE>
<DL>
<DD>This method indicates whether the JspWriter is autoFlushing.<DD><DL>
<DT><B>Returns:</B><DD>if this JspWriter is auto flushing or throwing IOExceptions on
buffer overflow conditions</DL>
</DD>
</DL>
<HR>
<A NAME="init(java.io.Writer, int, boolean)"><!-- --></A><H3>
init</H3>
<PRE>
private final void <B>init</B>(java.io.Writer&nbsp;writer,
int&nbsp;sz,
boolean&nbsp;autoFlush)</PRE>
<DL>
</DL>
<HR>
<A NAME="flushBuffer()"><!-- --></A><H3>
flushBuffer</H3>
<PRE>
private final void <B>flushBuffer</B>()
throws java.io.IOException</PRE>
<DL>
<DD>Flush the output buffer to the underlying character stream, without
flushing the stream itself. This method is non-private only so that it
may be invoked by PrintStream.</DL>
<HR>
<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public final void <B>clear</B>()</PRE>
<DL>
<DD>Discard the output buffer.</DL>
<HR>
<A NAME="bufferOverflow()"><!-- --></A><H3>
bufferOverflow</H3>
<PRE>
private final void <B>bufferOverflow</B>()
throws java.io.IOException</PRE>
<DL>
</DL>
<HR>
<A NAME="flush()"><!-- --></A><H3>
flush</H3>
<PRE>
public final void <B>flush</B>()
throws java.io.IOException</PRE>
<DL>
<DD>Flush the stream.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>flush</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public final void <B>close</B>()
throws java.io.IOException</PRE>
<DL>
<DD>Close the stream.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>close</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getRemaining()"><!-- --></A><H3>
getRemaining</H3>
<PRE>
public final int <B>getRemaining</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>the number of bytes unused in the buffer</DL>
</DD>
</DL>
<HR>
<A NAME="write(int)"><!-- --></A><H3>
write</H3>
<PRE>
public final void <B>write</B>(int&nbsp;c)
throws java.io.IOException</PRE>
<DL>
<DD>Write a single character.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>write</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="min(int, int)"><!-- --></A><H3>
min</H3>
<PRE>
private final int <B>min</B>(int&nbsp;a,
int&nbsp;b)</PRE>
<DL>
<DD>Our own little min method, to avoid loading
<code>java.lang.Math</code> if we've run out of file
descriptors and we're trying to print a stack trace.</DL>
<HR>
<A NAME="write(char[], int, int)"><!-- --></A><H3>
write</H3>
<PRE>
public final void <B>write</B>(char[]&nbsp;cbuf,
int&nbsp;off,
int&nbsp;len)
throws java.io.IOException</PRE>
<DL>
<DD>Write a portion of an array of characters.
<p> 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
<code>DiscardableBufferedWriter</code>s will not copy data unnecessarily.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>write</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cbuf</CODE> - A character array<DD><CODE>off</CODE> - Offset from which to start reading characters<DD><CODE>len</CODE> - Number of characters to write</DL>
</DD>
</DL>
<HR>
<A NAME="write(char[])"><!-- --></A><H3>
write</H3>
<PRE>
public final void <B>write</B>(char[]&nbsp;buf)
throws java.io.IOException</PRE>
<DL>
<DD>Write an array of characters. This method cannot be inherited from the
Writer class because it must suppress I/O exceptions.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>write</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="write(java.lang.String, int, int)"><!-- --></A><H3>
write</H3>
<PRE>
public final void <B>write</B>(java.lang.String&nbsp;s,
int&nbsp;off,
int&nbsp;len)
throws java.io.IOException</PRE>
<DL>
<DD>Write a portion of a String.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>write</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - String to be written<DD><CODE>off</CODE> - Offset from which to start reading characters<DD><CODE>len</CODE> - Number of characters to be written</DL>
</DD>
</DL>
<HR>
<A NAME="write(java.lang.String)"><!-- --></A><H3>
write</H3>
<PRE>
public final void <B>write</B>(java.lang.String&nbsp;s)
throws java.io.IOException</PRE>
<DL>
<DD>Write a string. This method cannot be inherited from the Writer class
because it must suppress I/O exceptions.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>write</CODE> in class <CODE>java.io.Writer</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="recycle(java.io.Writer)"><!-- --></A><H3>
recycle</H3>
<PRE>
public final void <B>recycle</B>(java.io.Writer&nbsp;writer)</PRE>
<DL>
<DD>resets this class so that it can be reused</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VelocityWriter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="VelocityWriter.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
Copyright © 2002 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>