Class java.io.FileOutputStream
All Packages This Package Previous Next
Class java.io.FileOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FileOutputStream
-
public class
FileOutputStream
-
extends OutputStream
File output stream, can be constructed from
a file descriptor or a file name.
-
See Also:
-
FileInputStream,
File
-
Version:
-
1.17, 08/10/95
-
Author:
-
Arthur van Hoff
-
FileOutputStream(String)
-
Creates an output file with the specified system dependent
file name.
-
FileOutputStream(int)
-
Creates an output file with the specified system dependent
file descriptor.
-
FileOutputStream(File)
-
Creates an output file with the specified File object.
-
close()
-
Closes the stream.
-
finalize()
-
Closes the stream when garbage is collected.
-
getFD()
-
Returns the file descriptor associated with this stream.
-
write(int)
-
Writes a byte of data.
-
write(byte[])
-
Writes an array of bytes.
-
write(byte[], int, int)
-
Writes a sub array of bytes.
FileOutputStream
public FileOutputStream(String name) throws IOException
-
Creates an output file with the specified system dependent
file name.
-
Parameters:
-
name
-
the system dependent file name
-
Throws: IOException
-
If the file is not found.
FileOutputStream
public FileOutputStream(int fd) throws IOException
-
Creates an output file with the specified system dependent
file descriptor.
-
Parameters:
-
fd
-
the system dependent file descriptor
-
Throws: IOException
-
If an I/O error has occurred.
FileOutputStream
public FileOutputStream(File file) throws IOException
-
Creates an output file with the specified File object.
-
Parameters:
-
file
-
the file to be opened for reading
-
Throws: IOException
-
If the file is not found.
write
public void write(int b) throws IOException
-
Writes a byte of data. This method will block until the byte is
actually written.
-
Parameters:
-
b
-
the byte to be written
-
Throws: IOException
-
If an I/O error has occurred.
-
Overrides:
-
write in class OutputStream
write
public void write(byte b[]) throws IOException
-
Writes an array of bytes. Will block until the bytes
are actually written.
-
Parameters:
-
b
-
the data to be written
-
Throws: IOException
-
If an I/O error has occurred.
-
Overrides:
-
write in class OutputStream
write
public void write(byte b[],
int off,
int len) throws IOException
-
Writes a sub array of bytes.
-
Parameters:
-
b
-
the data to be written
-
off
-
the start offset in the data
-
len
-
the number of bytes that are written
-
Throws: IOException
-
If an I/O error has occurred.
-
Overrides:
-
write in class OutputStream
close
public void close() throws IOException
-
Closes the stream. This method must be called
to release any resources associated with the
stream.
-
Throws: IOException
-
If an I/O error has occurred.
-
Overrides:
-
close in class OutputStream
getFD
public final int getFD()
-
Returns the file descriptor associated with this stream.
-
Returns:
-
the file descriptor.
finalize
protected void finalize() throws IOException
-
Closes the stream when garbage is collected.
All Packages This Package Previous Next