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:

  • FileOutputStream(String name)
    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.


  • FileOutputStream(String name, boolean append)
    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.


  • FileOutputStream(File file)
    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.


  • FileOutputStream(File file, boolean append)
    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.

  • FileOutputStream(FileDescriptor fdObject)
    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:



    Other articles

    Click here to Article home

     
    uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
    MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
    Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
    © 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.