*** FILE IO PACKAGE: [DURGA VOLUME2 -194]
------------------------------------------
1 File
2 FileWriter
3 FileReader
4 BufferedWriter
5 BuffereReader
-----------------------------------------------
1 File:-
--------
Q- what is File ? what it represent ?
and :- it s class/object , represent file and also directory.
Q-file class constructor ?
Q- what are impotant methods in File class ?
------------------------------------------
**2 FileWriter: - using filewriter we can write character data to the file.
---------------
** CONSTRUCOTRS:-
---------------
Q-imp mehtod in FileWriter ?
Imp-note:- what are prob with filewriter ?
-----------------------------------------------------------------------------------
**3 FileReader: - using fileReader we can read character data from the file.
---------------
**CONSTRUCTOR:-
---------------
Q- what is imp method are in FileReader?
Note:- usage of FileWriter and FileReader is not recomended because ?
---------------------------------------------------------------------------------
**4 BufferWriter: - using BufferedWriter obj we can write character data from the
file.
---------------
** CONSTRUCTORS:-
Q- imp mehtod in BufferWriter?
Q- what BufferedWriter do extra from Writer ?
---------------------------------------------------------------------
**4 BufferReader: - this is most enhanced reader to read character data from the
file.
---------------
** CONSTRUCTORS:-
Q- imp mehtod in BufferReader?
-----------------------------------------------------------
** 5 PrintWriter :-
--------------------
> most enhanced writer to write text data to file
> using printwriter we can write any type of data to file.
** CONSTRUCTORS:-
Q- imp mehtod in PrintWriter ?
Q- what is diff bw write(100) and print(100);
Imp_note:-
==========
1-> the most enhanced Reader to read character data from file is - BufferedReader
2-> the most enhanced Writer to write character data to the File is - PrintWriter.
3-> in general, we can use Readers and Writers to handle character data.
where as
we can use InputStream and OutPutStream to handle binary data (like images,
audio files, video files)
4 we can use OutPutStream to write binary data to the File
and
we can use InputStream to read binary data from file.
IMP_Diagrame:
-------------
Object
|
__________________________________________________________________
| |
Writer(AC)
Reader(AC)
______________________|___________________________
____________________|______________________
| | | |
|
OutputStreamWriter BufferedWriter PrintWriter InputStreamReader
BufferReader
| |
FileWriter FileReader