java.io
Class FileOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FileOutputStream

public class FileOutputStream
extends OutputStream

FileOutputStream provides the functionality to write to files. This class inherits the write methods of class OutputStream.


Constructor Summary
FileOutputStream(File f)
          Creates a new FileOutputStream to write to the specified file.
FileOutputStream(String name)
          Creates a new FileOutputStream to write to the specified file.
 
Method Summary
 void close()
          Closes this stream and releases all system resources associated with it.
 void flush()
          Flushes this output stream.
 void write(byte[] b, int off, int len)
          Writes len bytes from b to this output stream starting at offset off.
 void write(int b)
          Writes a single byte to this output stream.
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, toString
 

Constructor Detail

FileOutputStream

public FileOutputStream(String name)
Creates a new FileOutputStream to write to the specified file.

Parameters:
name - Name of the file to write to.

FileOutputStream

public FileOutputStream(File f)
Creates a new FileOutputStream to write to the specified file.

Method Detail

write

public void write(int b)
           throws IOException
Writes a single byte to this output stream.

Specified by:
write in class OutputStream
Throws:
IOException - if an I/O error occures.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Writes len bytes from b to this output stream starting at offset off.

Overrides:
write in class OutputStream
Parameters:
b - Array of bytes containing the data to be written.
off - Offset into b where the data begins.
len - Number of bytes to be written.
Throws:
IOException - if an I/O error occures.

flush

public void flush()
           throws IOException
Flushes this output stream.

Overrides:
flush in class OutputStream
IOException

close

public void close()
           throws IOException
Closes this stream and releases all system resources associated with it.

Overrides:
close in class OutputStream
IOException