Topics
1.Introduction to Input and Output Stream in java.
In Java, FileInputStream and FileOutputStream classes are used to read and write data in file. In another words, they are used for file handling in java.
2.Output Stream
1.Introduction to Input and Output Stream in java.
In Java, FileInputStream and FileOutputStream classes are used to read and write data in file. In another words, they are used for file handling in java.
2.Output Stream
Java FileOutputStream is an output stream for writing data to a file.
If you have to write primitive values then use FileOutputStream.Instead, for character-oriented data, prefer FileWriter.But you can write byte-oriented as well as character-oriented data.
File Handling and Input/Output
- java.io package
- Classes related to input and output are present in the JavaTM language package java.io . Java technology uses "streams" as a general mechanism of handling data. Input streams act as a source of data. Output streams act as a destination of data.
- File class
- The file class is used to store the path and name of a directory or file. The file object can be used to create, rename, or delete the file or directory it represents. The File class has the
IO Stream
Java performs I/O through Streams. A Stream is linked to a physical layer by java I/O system to make input and output operation in java. In general, a stream means continuous flow of data. Streams are clean way to deal with input/output without having every part of your code understand the physical.
Java encapsulates Stream under java.io package. Java defines two types of streams. They are,
- Byte Stream : It provides a convenient means for handling input and output of byte.
- Character Stream : It provides a convenient means for handling input and output of characters. Character stream uses Unicode and therefore can be internationalized.
No comments:
Post a Comment