Public class FileOutputStream extends OutputStreams
Constructor | Description |
---|---|
FileOutputStream (File file) | A file output stream is created by this constructor and writes to the represented file object. |
FileOutputStream (String name) | A file output stream is created by this constructor and writes to the represented name. |
FileOutputStream (FileDescriptor fdObj) | A file output stream object is created by this constructor and used the file descriptor to represent the connection of actual file to write. |
FileOutputStream (String name, boolean append) | A file output stream is created by this constructor to write into file represented by name. |
Method | Description |
---|---|
void close() | By using this method the file output stream is closed and releases the another resources related to this stream. |
void write(byte[] b) | By using this method it writes the data up to ‘n’ bytes from the output stream into an array of bytes. |
void write(int b) | By using this method it writes the data to the file output stream. |
void write(byte[] b, int off, int n) | By using this method it reads the data up to ‘n’ bytes from the output stream into an array of bytes starting at offset of this file output stream. |
protected void finalize() | By using this method it can close the output stream at that time close method is called, only when there are no more actions to perform. |
FileChannel getChannel() | Associating with file output stream the current method returns unique File Channel object. |
FileDescriptor getFD() | By using this method it returns file descriptor associating with file output stream. |