Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
java.io

Class FileWriter

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public class FileWriter
    extends OutputStreamWriter
    Convenience class for writing character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are acceptable. To specify these values yourself, construct an OutputStreamWriter on a FileOutputStream.

    Whether or not a file is available or may be created depends upon the underlying platform. Some platforms, in particular, allow a file to be opened for writing by only one FileWriter (or other file-writing object) at a time. In such situations the constructors in this class will fail if the file involved is already open.

    FileWriter is meant for writing streams of characters. For writing streams of raw bytes, consider using a FileOutputStream.

    Since:
    JDK1.1
    See Also:
    OutputStreamWriter, FileOutputStream
    • Constructor Detail
      • FileWriter
        public FileWriter(String fileName)
                   throws IOException
        Constructs a FileWriter object given a file name.
        Parameters:
        fileName - String The system-dependent filename.
        Throws:
        IOException - if the named file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
      • FileWriter
        public FileWriter(String fileName,
                  boolean append)
                   throws IOException
        Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written.
        Parameters:
        fileName - String The system-dependent filename.
        append - boolean if true, then data will be written to the end of the file rather than the beginning.
        Throws:
        IOException - if the named file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
      • FileWriter
        public FileWriter(File file)
                   throws IOException
        Constructs a FileWriter object given a File object.
        Parameters:
        file - a File object to write to.
        Throws:
        IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
      • FileWriter
        public FileWriter(File file,
                  boolean append)
                   throws IOException
        Constructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
        Parameters:
        file - a File object to write to
        append - if true, then bytes will be written to the end of the file rather than the beginning
        Throws:
        IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
        Since:
        1.4
      • FileWriter
        public FileWriter(FileDescriptor fd)
        Constructs a FileWriter object associated with a file descriptor.
        Parameters:
        fd - FileDescriptor object to write to.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-java/io/FileWriter.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut