<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.io.BufferedWriter
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.io.html">This Package</a>  <a href="java.io.BufferedReader.html#_top_">Previous</a>  <a href="java.io.ByteArrayInputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.BufferedWriter
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.Writer.html#_top_">java.io.Writer</a>
           |
           +----java.io.BufferedWriter
</pre>
<hr>
<dl>
  <dt> public class <b>BufferedWriter</b>
  <dt> extends <a href="java.io.Writer.html#_top_">Writer</a>
</dl>
Write text to a character-output stream, buffering characters so as to
 provide for the efficient writing of single characters, arrays, and strings.
 <p> The buffer size may be specified, or the default size may be accepted.
 The default is large enough for most purposes.
 <p> A newLine() method is provided, which uses the platform's own notion of
 line separator as defined by the system property <tt>line.separator</tt>.
 Not all platforms use the newline character ('\n') to terminate lines.
 Calling this method to terminate each output line is therefore preferred to
 writing a newline character directly.
 <p> In general, a Writer sends its output immediately to the underlying
 character or byte stream.  Unless prompt output is required, it is advisable
 to wrap a BufferedWriter around any Writer whose write() operations may be
 costly, such as FileWriters and OutputStreamWriters.  For example,
 <pre>
 PrintWriter out
   = new PrintWriter(new BufferedWriter(new FileWriter("foo.out")));
 </pre>
 will buffer the PrintWriter's output to the file.  Without buffering, each
 invocation of a print() method would cause characters to be converted into
 bytes that would then be written immediately to the file, which can be very
 inefficient.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.PrintWriter.html#_top_">PrintWriter</a>, <a href="java.io.FileWriter.html#_top_">FileWriter</a>, <a href="java.io.OutputStreamWriter.html#_top_">OutputStreamWriter</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#BufferedWriter(java.io.Writer)"><b>BufferedWriter</b></a>(Writer)
  <dd>  Create a buffered character-output stream that uses a default-sized
 output buffer.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#BufferedWriter(java.io.Writer, int)"><b>BufferedWriter</b></a>(Writer, int)
  <dd>  Create a new buffered character-output stream that uses an output
 buffer of the given size.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#close()"><b>close</b></a>()
  <dd>  Close the stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#flush()"><b>flush</b></a>()
  <dd>  Flush the stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#newLine()"><b>newLine</b></a>()
  <dd>  Write a line separator.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(char[], int, int)"><b>write</b></a>(char[], int, int)
  <dd>  Write a portion of an array of characters.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(int)"><b>write</b></a>(int)
  <dd>  Write a single character.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(java.lang.String, int, int)"><b>write</b></a>(String, int, int)
  <dd>  Write a portion of a String.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="BufferedWriter"></a>
<a name="BufferedWriter(java.io.Writer)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>BufferedWriter</b>
<pre>
 public BufferedWriter(<a href="java.io.Writer.html#_top_">Writer</a> out)
</pre>
<dl>
  <dd> Create a buffered character-output stream that uses a default-sized
 output buffer.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> out - A Writer
  </dl></dd>
</dl>
<a name="BufferedWriter(java.io.Writer, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>BufferedWriter</b>
<pre>
 public BufferedWriter(<a href="java.io.Writer.html#_top_">Writer</a> out,
                       int sz)
</pre>
<dl>
  <dd> Create a new buffered character-output stream that uses an output
 buffer of the given size.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> out - A Writer
    <dd> sz - Output-buffer size, a positive integer
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> If sz is <= 0
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="write(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="write"><b>write</b></a>
<pre>
 public void write(int c) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Write a single character.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If an I/O error occurs
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.Writer.html#write(int)">write</a> in class <a href="java.io.Writer.html#_top_">Writer</a>
  </dl></dd>
</dl>
<a name="write(char[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="write"><b>write</b></a>
<pre>
 public void write(char cbuf[],
                   int off,
                   int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</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>BufferedWriter</code>s will not copy data unnecessarily.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> cbuf - A character array
    <dd> off - Offset from which to start reading characters
    <dd> len - Number of characters to write
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If an I/O error occurs
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.Writer.html#write(char[], int, int)">write</a> in class <a href="java.io.Writer.html#_top_">Writer</a>
  </dl></dd>
</dl>
<a name="write(java.lang.String, int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="write"><b>write</b></a>
<pre>
 public void write(<a href="java.lang.String.html#_top_">String</a> s,
                   int off,
                   int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Write a portion of a String.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> s - String to be written
    <dd> off - Offset from which to start reading characters
    <dd> len - Number of characters to be written
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If an I/O error occurs
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.Writer.html#write(java.lang.String, int, int)">write</a> in class <a href="java.io.Writer.html#_top_">Writer</a>
  </dl></dd>
</dl>
<a name="newLine()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="newLine"><b>newLine</b></a>
<pre>
 public void newLine() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Write a line separator.  The line separator string is defined by the
 system property <tt>line.separator</tt>, and is not necessarily a single
 newline ('\n') character.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If an I/O error occurs
  </dl></dd>
</dl>
<a name="flush()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="flush"><b>flush</b></a>
<pre>
 public void flush() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Flush the stream.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If an I/O error occurs
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.Writer.html#flush()">flush</a> in class <a href="java.io.Writer.html#_top_">Writer</a>
  </dl></dd>
</dl>
<a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="close"><b>close</b></a>
<pre>
 public void close() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Close the stream.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If an I/O error occurs
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.Writer.html#close()">close</a> in class <a href="java.io.Writer.html#_top_">Writer</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.io.html">This Package</a>  <a href="java.io.BufferedReader.html#_top_">Previous</a>  <a href="java.io.ByteArrayInputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
