<!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.PrintStream
</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.PipedWriter.html#_top_">Previous</a>  <a href="java.io.PrintWriter.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.PrintStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.OutputStream.html#_top_">java.io.OutputStream</a>
           |
           +----<a href="java.io.FilterOutputStream.html#_top_">java.io.FilterOutputStream</a>
                   |
                   +----java.io.PrintStream
</pre>
<hr>
<dl>
  <dt> public class <b>PrintStream</b>
  <dt> extends <a href="java.io.FilterOutputStream.html#_top_">FilterOutputStream</a>
</dl>
Print values and objects to an output stream, using the platform's default
 character encoding to convert characters into bytes.
 <p> If automatic flushing is enabled at creation time, then the stream will
 be flushed each time a line is terminated or a newline character is written.
 <p> Methods in this class never throw I/O exceptions.  Client code may
 inquire as to whether any errors have occurred by invoking the
 <code>checkError</code> method.
 <p><b>Note:</b> <i>This class is provided primarily for use in debugging,
 and for compatibility with existing code; new code should use the
 PrintWriter class.</i>
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.PrintWriter.html#_top_">PrintWriter</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="#PrintStream(java.io.OutputStream)"><b>PrintStream</b></a>(OutputStream)
  <dd>  Create a new print stream.
<b>Deprecated.</b>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PrintStream(java.io.OutputStream, boolean)"><b>PrintStream</b></a>(OutputStream, boolean)
  <dd>  Create a new PrintStream.
<b>Deprecated.</b>
</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="#checkError()"><b>checkError</b></a>()
  <dd>  Flush the stream and check its error state.
  <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="#print(boolean)"><b>print</b></a>(boolean)
  <dd>  Print a boolean value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(char)"><b>print</b></a>(char)
  <dd>  Print a character.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(char[])"><b>print</b></a>(char[])
  <dd>  Print an array of characters.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(double)"><b>print</b></a>(double)
  <dd>  Print a double-precision floating-point number.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(float)"><b>print</b></a>(float)
  <dd>  Print a floating-point number.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(int)"><b>print</b></a>(int)
  <dd>  Print an integer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(long)"><b>print</b></a>(long)
  <dd>  Print a long integer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(java.lang.Object)"><b>print</b></a>(Object)
  <dd>  Print an object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#print(java.lang.String)"><b>print</b></a>(String)
  <dd>  Print a string.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println()"><b>println</b></a>()
  <dd>  Finish the current line by writing a line separator.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(boolean)"><b>println</b></a>(boolean)
  <dd>  Print a boolean, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(char)"><b>println</b></a>(char)
  <dd>  Print a character, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(char[])"><b>println</b></a>(char[])
  <dd>  Print an array of characters, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(double)"><b>println</b></a>(double)
  <dd>  Print a double, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(float)"><b>println</b></a>(float)
  <dd>  Print a float, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(int)"><b>println</b></a>(int)
  <dd>  Print an integer, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(long)"><b>println</b></a>(long)
  <dd>  Print a long, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(java.lang.Object)"><b>println</b></a>(Object)
  <dd>  Print an Object, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(java.lang.String)"><b>println</b></a>(String)
  <dd>  Print a String, and then finish the line.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setError()"><b>setError</b></a>()
  <dd> Indicate that an error has occurred.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(byte[], int, int)"><b>write</b></a>(byte[], int, int)
  <dd>  Write a portion of a byte array, blocking if necessary.
  <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 byte, blocking if necessary.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="PrintStream"></a>
<a name="PrintStream(java.io.OutputStream)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>PrintStream</b>
<pre>
 public PrintStream(<a href="java.io.OutputStream.html#_top_">OutputStream</a> out)
</pre>
<dl>
<dd><b> Note: PrintStream() is deprecated.</b>
<i>As of JDK&nbsp;1.1, the preferred way to print text is
 via the PrintWriter class.  Consider replacing code of the<br>
 form &nbsp;<code>    PrintStream p = new PrintStream(out);</code><br>
 with &nbsp;<code>    PrintWriter p = new PrintWriter(out);</code></i>
<p>
  <dd> Create a new print stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> out - The output stream to which values and objects will be
                    printed
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.PrintWriter.html#PrintWriter(java.io.OutputStream)">PrintWriter</a>
  </dl></dd>
</dl>
<a name="PrintStream(java.io.OutputStream, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>PrintStream</b>
<pre>
 public PrintStream(<a href="java.io.OutputStream.html#_top_">OutputStream</a> out,
                    boolean autoFlush)
</pre>
<dl>
<dd><b> Note: PrintStream() is deprecated.</b>
<i>As of JDK&nbsp;1.1, the preferred way to print text is
 via the PrintWriter class.  Consider replacing code of the<br>
 form &nbsp;<code>    PrintStream p = new PrintStream(out, autoFlush);</code><br>
 with &nbsp;<code>    PrintWriter p = new PrintWriter(out, autoFlush);</code></i>
<p>
  <dd> Create a new PrintStream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> out - The output stream to which values and objects will be
                    printed
    <dd> autoFlush - A boolean; if true, the output buffer will be flushed
                    whenever a line is terminated or a newline character
                    (<code>'\n'</code>) is written
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.PrintWriter.html#PrintWriter(java.io.OutputStream, boolean)">PrintWriter</a>
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<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()
</pre>
<dl>
  <dd> Flush the stream.  This is done by writing any buffered output bytes to
 the underlying output stream and then flushing that stream.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.FilterOutputStream.html#flush()">flush</a> in class <a href="java.io.FilterOutputStream.html#_top_">FilterOutputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.OutputStream.html#flush()">flush</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()
</pre>
<dl>
  <dd> Close the stream.  This is done by flushing the stream and then closing
 the underlying output stream.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.FilterOutputStream.html#close()">close</a> in class <a href="java.io.FilterOutputStream.html#_top_">FilterOutputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.OutputStream.html#close()">close</a>
  </dl></dd>
</dl>
<a name="checkError()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="checkError"><b>checkError</b></a>
<pre>
 public boolean checkError()
</pre>
<dl>
  <dd> Flush the stream and check its error state.  Errors are cumulative;
 once the stream encounters an error, this routine will continue to
 return true on all successive calls.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> True if the print stream has encountered an error, either on the
 underlying output stream or during a format conversion, otherwise false.
  </dl></dd>
</dl>
<a name="setError()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setError"><b>setError</b></a>
<pre>
 protected void setError()
</pre>
<dl>
  <dd> Indicate that an error has occurred.
<p>
</dl>
<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 b)
</pre>
<dl>
  <dd> Write a byte, blocking if necessary.  If the character is a newline and
 automatic flushing is enabled, the stream's <code>flush</code> method
 will be called.
 <p> Note that the byte is written as given; to write a character that
 will be translated according to the platform's default character
 encoding, use the <code>print(char)</code> or <code>println(char)</code>
 methods.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - The byte to be written
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.FilterOutputStream.html#write(int)">write</a> in class <a href="java.io.FilterOutputStream.html#_top_">FilterOutputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(char)">print</a>, <a href="#println(char)">println</a>
  </dl></dd>
</dl>
<a name="write(byte[], 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(byte buf[],
                   int off,
                   int len)
</pre>
<dl>
  <dd> Write a portion of a byte array, blocking if necessary.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> buf - A byte array
    <dd> off - Offset from which to start taking bytes
    <dd> len - Number of bytes to write
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.FilterOutputStream.html#write(byte[], int, int)">write</a> in class <a href="java.io.FilterOutputStream.html#_top_">FilterOutputStream</a>
  </dl></dd>
</dl>
<a name="print(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(boolean b)
</pre>
<dl>
  <dd> Print a boolean value.  If the given value is true, then the string
 <code>"true"</code> is written to the underlying output stream;
 otherwise, the string <code>"false"</code> is written.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - The <code>boolean</code> to be printed
  </dl></dd>
</dl>
<a name="print(char)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(char c)
</pre>
<dl>
  <dd> Print a character.  The character is translated into one or more bytes
 according to the platform's default character encoding.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> c - The <code>char</code> to be printed
  </dl></dd>
</dl>
<a name="print(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(int i)
</pre>
<dl>
  <dd> Print an integer.  The string printed is the same as that returned by
 the <code>toString</code> method of the <code>Integer</code> class when
 invoked on the given <code>int</code> value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> i - The <code>int</code> to be printed
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.Integer.html#toString(int)">toString</a>
  </dl></dd>
</dl>
<a name="print(long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(long l)
</pre>
<dl>
  <dd> Print a long integer.  The string printed is the same as that returned
 by the <code>toString</code> method of the <code>Long</code> class when
 invoked on the given <code>long</code> value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> l - The <code>long</code> to be printed
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.Long.html#toString(long)">toString</a>
  </dl></dd>
</dl>
<a name="print(float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(float f)
</pre>
<dl>
  <dd> Print a floating-point number.  The string printed is the same as that
 returned by the <code>toString</code> method of the <code>Float</code>
 class when invoked on the given <code>float</code> value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> f - The <code>float</code> to be printed
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.Float.html#toString(float)">toString</a>
  </dl></dd>
</dl>
<a name="print(double)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(double d)
</pre>
<dl>
  <dd> Print a double-precision floating-point number.  The string printed is
 the same as that returned by the <code>toString</code> method of the
 <code>Double</code> class when invoked on the given <code>double</code>
 value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> d - The <code>double</code> to be printed
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.Double.html#toString(double)">toString</a>
  </dl></dd>
</dl>
<a name="print(char[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(char s[])
</pre>
<dl>
  <dd> Print an array of characters.  The characters are converted into bytes
 according to the platform's default character encoding.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> s - The array of chars to be printed
  </dl></dd>
</dl>
<a name="print(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(<a href="java.lang.String.html#_top_">String</a> s)
</pre>
<dl>
  <dd> Print a string.  If the argument is <code>null</code>, the string
 <code>"null"</code> is written to the underlying output stream.
 Otherwise, the string's characters are converted into bytes according to
 the platform's default character encoding.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> s - The <code>String</code> to be printed
  </dl></dd>
</dl>
<a name="print(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="print"><b>print</b></a>
<pre>
 public void print(<a href="java.lang.Object.html#_top_">Object</a> obj)
</pre>
<dl>
  <dd> Print an object.  The string printed is the same as that returned by the
 given object's <code>toString</code> method.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> obj - The <code>Object</code> to be printed
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a>
  </dl></dd>
</dl>
<a name="println()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println()
</pre>
<dl>
  <dd> Finish the current line by writing a line separator.  The line
 separator string is defined by the system property
 <code>line.separator</code>, and is not necessarily a single newline
 character (<code>'\n'</code>).
<p>
</dl>
<a name="println(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(boolean x)
</pre>
<dl>
  <dd> Print a boolean, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(boolean)">print</a>
  </dl></dd>
</dl>
<a name="println(char)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(char x)
</pre>
<dl>
  <dd> Print a character, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(char)">print</a>
  </dl></dd>
</dl>
<a name="println(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(int x)
</pre>
<dl>
  <dd> Print an integer, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(int)">print</a>
  </dl></dd>
</dl>
<a name="println(long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(long x)
</pre>
<dl>
  <dd> Print a long, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(long)">print</a>
  </dl></dd>
</dl>
<a name="println(float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(float x)
</pre>
<dl>
  <dd> Print a float, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(float)">print</a>
  </dl></dd>
</dl>
<a name="println(double)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(double x)
</pre>
<dl>
  <dd> Print a double, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(double)">print</a>
  </dl></dd>
</dl>
<a name="println(char[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(char x[])
</pre>
<dl>
  <dd> Print an array of characters, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(char[])">print</a>
  </dl></dd>
</dl>
<a name="println(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(<a href="java.lang.String.html#_top_">String</a> x)
</pre>
<dl>
  <dd> Print a String, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(String)">print</a>
  </dl></dd>
</dl>
<a name="println(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public void println(<a href="java.lang.Object.html#_top_">Object</a> x)
</pre>
<dl>
  <dd> Print an Object, and then finish the line.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#print(Object)">print</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.PipedWriter.html#_top_">Previous</a>  <a href="java.io.PrintWriter.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
