File Handling Classes in Java

In this section, you will get to know about file handling classes in java to handle the file input output operations.

File Handling Classes in Java

File Handling Classes in Java

In this section, you will get to know about file handling classes in java to handle the file input output operations.

Some of the main file handling classes and it description is given below :

  •  InputStream
    All the classes which represents an input data stream of bytes are super classed by this abstract class.

  • OutputStream
    All the classes which represents an output data stream of bytes are super classed by this abstract class.

  • FilterOutputStream
    All classes which are filtered by the output data streams are super classed by FilterOutputStream class.

  • FileOutputStream
    This output data stream is utilized for writing data to a FileDescriptor or File.

  • ByteArrayOutputStream
    The ByteArrayOutputStream implements an output stream for writing data by byte array.

  • ByteArrayInputStream
    ByteArrayInputStream have an internal buffer which holds bytes which can be read from the stream.

  • FileInputStream
    This input stream receives input bytes from a file within a file system.

  • FilterInputStream
    A FilterInputStream takes other input stream ,which is also the main source of data for it, maybe converting the data on the way or supplying other functionality.

  • StringBufferInputStream
    StringBufferInputStream permits an application to produce an input data stream in which read bytes are provided by the string's contents.

  • SequenceInputStream
    Other input stream can be logically concatenated through SequenceInputStream.

  • BufferedOutputStream
    A buffered output stream is implemented by the BufferedOutputStream class.

  • DataOutputStream
    This data output stream alllows an application to write primitive data types of Java to an output stream.

  • PrintStream
    This stream appends functionality to other output stream, for example it provides ability to print several data values representations easily.

  • BufferedInputStream
    This stream appends functionality to other input streams, for example it supports reset and mark functions and also provide ability of input buffer.

  • DataInputStream
    The DataInputStream allows an application to read primitive data types of Java from a particular input stream.

  • PushbackInputStream
    This input stream provides functionality to other input stream, for example- "unread" one byte or "push back".