What is the FileOutputStream class?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the FileOutputStream class?
Rating:
The FileOutputStream class is used to perform simple file output operations. It is used to write binary data to a file. The FileOutputStream class can be instantiated by using any of the following constructors:
This constructor creates a connection to write to the file with the name specified in the argument. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.
This constructor creates a connection to write to the file with the name specified in the argument. If the second argument of the constructor is true, the bytes are written to the end of the file rather than to the beginning of the file. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.
This constructor creates an OutputStream and establishes a connection with the actual file. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.
This constructor creates an OutputStream and establishes a connection with the actual file. If the second argument of the constructor is true, the bytes are written to the end of the file rather than to the beginning of the file. It throws a FileNotFoundException if the file does not exist or cannot be opened for some reason.
This constructor uses a file descriptor object to write to a specified file. The file descriptor object represents a connection with the existing file.
Rating:
Was this information helpful?
Other articles
- What is the NotSerializableException?
- What is the toHexString() method of the Long class?
- What is the for loop?
- What is static import?
- What is a block?