<!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.FileOutputStream
</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.FileInputStream.html#_top_">Previous</a>  <a href="java.io.FileReader.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.FileOutputStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.OutputStream.html#_top_">java.io.OutputStream</a>
           |
           +----java.io.FileOutputStream
</pre>
<hr>
<dl>
  <dt> public class <b>FileOutputStream</b>
  <dt> extends <a href="java.io.OutputStream.html#_top_">OutputStream</a>
</dl>
A file output stream is an output stream for writing data to a 
 <code>File</code> or to a <code>FileDescriptor</code>.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.File.html#_top_">File</a>, <a href="java.io.FileDescriptor.html#_top_">FileDescriptor</a>, <a href="java.io.FileInputStream.html#_top_">FileInputStream</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="#FileOutputStream(java.io.File)"><b>FileOutputStream</b></a>(File)
  <dd>  Creates a file output stream to write to the specified 
 <code>File</code> object.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#FileOutputStream(java.io.FileDescriptor)"><b>FileOutputStream</b></a>(FileDescriptor)
  <dd>  Creates an output file stream to write to the specified file descriptor.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#FileOutputStream(java.lang.String)"><b>FileOutputStream</b></a>(String)
  <dd>  Creates an output file stream to write to the file with the 
 specified name.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#FileOutputStream(java.lang.String, boolean)"><b>FileOutputStream</b></a>(String, boolean)
  <dd>  Creates an output file with the specified system dependent
 file name.
</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>  Closes this file output stream and releases any system resources 
 associated with this stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#finalize()"><b>finalize</b></a>()
  <dd>  Ensures that the <code>close</code> method of this file output stream is
 called when there are no more references to this stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getFD()"><b>getFD</b></a>()
  <dd>  Returns the file descriptor associated with this stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(byte[])"><b>write</b></a>(byte[])
  <dd>  Writes <code>b.length</code> bytes from the specified byte array 
 to this file output stream.
  <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>  Writes <code>len</code> bytes from the specified byte array 
 starting at offset <code>off</code> to this file output stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(int)"><b>write</b></a>(int)
  <dd>  Writes the specified byte to this file output stream.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="FileOutputStream"></a>
<a name="FileOutputStream(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FileOutputStream</b>
<pre>
 public FileOutputStream(<a href="java.lang.String.html#_top_">String</a> name) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Creates an output file stream to write to the file with the 
 specified name.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the system-dependent filename.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if the file could not be opened for writing.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if a security manager exists, its
               <code>checkWrite</code> method is called with the name
               argument to see if the application is allowed write access
               to the file.
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.SecurityManager.html#checkWrite(java.lang.String)">checkWrite</a>
  </dl></dd>
</dl>
<a name="FileOutputStream(java.lang.String, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FileOutputStream</b>
<pre>
 public FileOutputStream(<a href="java.lang.String.html#_top_">String</a> name,
                         boolean append) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Creates an output file with the specified system dependent
 file name.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the system dependent file name
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If the file is not found.
  </dl></dd>
</dl>
<a name="FileOutputStream(java.io.File)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FileOutputStream</b>
<pre>
 public FileOutputStream(<a href="java.io.File.html#_top_">File</a> file) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Creates a file output stream to write to the specified 
 <code>File</code> object.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> file - the file to be opened for writing.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if the file could not be opened for
               writing.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if a security manager exists, its
               <code>checkWrite</code> method is called with the pathname
               of the <code>File</code> argument to see if the
               application is allowed write access to the file. This may
               result in a security exception.
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.File.html#getPath()">getPath</a>, <a href="java.lang.SecurityException.html#_top_">SecurityException</a>, <a href="java.lang.SecurityManager.html#checkWrite(java.lang.String)">checkWrite</a>
  </dl></dd>
</dl>
<a name="FileOutputStream(java.io.FileDescriptor)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FileOutputStream</b>
<pre>
 public FileOutputStream(<a href="java.io.FileDescriptor.html#_top_">FileDescriptor</a> fdObj)
</pre>
<dl>
  <dd> Creates an output file stream to write to the specified file descriptor.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> fdObj - the file descriptor to be opened for writing.
    <dt> <b>Throws:</b> <a href="java.lang.SecurityException.html#_top_">SecurityException</a>
    <dd> if a security manager exists, its
               <code>checkWrite</code> method is called with the file
               descriptor to see if the application is allowed to write
               to the specified file descriptor.
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.SecurityManager.html#checkWrite(java.io.FileDescriptor)">checkWrite</a>
  </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 native void write(int b) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Writes the specified byte to this file output stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the byte 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.OutputStream.html#write(int)">write</a> in class <a href="java.io.OutputStream.html#_top_">OutputStream</a>
  </dl></dd>
</dl>
<a name="write(byte[])"><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 b[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Writes <code>b.length</code> bytes from the specified byte array 
 to this file output stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the data.
    <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.OutputStream.html#write(byte[])">write</a> in class <a href="java.io.OutputStream.html#_top_">OutputStream</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 b[],
                   int off,
                   int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Writes <code>len</code> bytes from the specified byte array 
 starting at offset <code>off</code> to this file output stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the data.
    <dd> off - the start offset in the data.
    <dd> len - the number of bytes 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.OutputStream.html#write(byte[], int, int)">write</a> in class <a href="java.io.OutputStream.html#_top_">OutputStream</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 native void close() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Closes this file output stream and releases any system resources 
 associated with this 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.OutputStream.html#close()">close</a> in class <a href="java.io.OutputStream.html#_top_">OutputStream</a>
  </dl></dd>
</dl>
<a name="getFD()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getFD"><b>getFD</b></a>
<pre>
 public final <a href="java.io.FileDescriptor.html#_top_">FileDescriptor</a> getFD() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns the file descriptor associated with this stream.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the file descriptor object associated with this stream.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.FileDescriptor.html#_top_">FileDescriptor</a>
  </dl></dd>
</dl>
<a name="finalize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="finalize"><b>finalize</b></a>
<pre>
 protected void finalize() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Ensures that the <code>close</code> method of this file output stream is
 called when there are no more references to this 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.lang.Object.html#finalize()">finalize</a> in class <a href="java.lang.Object.html#_top_">Object</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.FileInputStream.html#close()">close</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.FileInputStream.html#_top_">Previous</a>  <a href="java.io.FileReader.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
