|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FileOutputStream
File output stream, can be constructed from a file descriptor or a file name.
FileInputStream
,
File
Constructor Summary | |
FileOutputStream(File file)
Creates an output file with the specified File object. |
|
FileOutputStream(FileDescriptor fdObj)
|
|
FileOutputStream(String name)
Creates an output file with the specified system dependent file name. |
Method Summary | |
void |
close()
Closes the stream. |
protected void |
finalize()
Closes the stream when garbage is collected. |
FileDescriptor |
getFD()
Returns the file descriptor associated with this stream. |
void |
write(byte[] b)
Writes an array of bytes. |
void |
write(byte[] b,
int off,
int len)
Writes a sub array of bytes. |
void |
write(int b)
Writes a byte of data. |
Methods inherited from class java.io.OutputStream |
flush |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileOutputStream(String name) throws IOException
name
- the system dependent file name
IOException
- If the file is not found.public FileOutputStream(File file) throws IOException
file
- the file to be opened for reading
IOException
- If the file is not found.public FileOutputStream(FileDescriptor fdObj)
Method Detail |
public void write(int b) throws IOException
write
in class OutputStream
b
- the byte to be written
IOException
- If an I/O error has occurred.public void write(byte[] b) throws IOException
write
in class OutputStream
b
- the data to be written
IOException
- If an I/O error has occurred.public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
b
- the data to be writtenoff
- the start offset in the datalen
- the number of bytes that are written
IOException
- If an I/O error has occurred.public void close() throws IOException
close
in class OutputStream
IOException
- If an I/O error has occurred.public final FileDescriptor getFD() throws IOException
IOException
protected void finalize() throws IOException
finalize
in class Object
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |