FileReader used to read the character stream in the file.i.e a file that contanis only the character means FileReader is the choice to read the file.On the other hand if the file contains image,byte like raw data format means FileInputStream is the choice to read the data in the file,.
First of all, these two classes are on different levels of abstraction. An InputStream is used for reading any stream of bytes, while a FileReader is used to read characters from a file. If you want to ask between a FileInputStream and a FileReader, then we need to look at what type of data you are reading. If you're reading plain-text file, for example, you want to use a FileReader because it was designed to read in characters. For other types of data, the FileInputStream would be better, as it is used to read in generic streams of bytes from a file.
These streams are classified as mode streams as they read and write data from disk files. the classes associated with these streams have constructos that allows us to specify the path of the file to which they are connected. The FileInputStream class allows us to read input from a file in the form of a stream. The FileOutputStream class allows us to write output to a file stream. Example, FileInputStream inputfile = new FileInputStream ("Empolyee.dat"); FileOutputStream outputfile = new FileOutputStream ("binus.dat");
import java.io.*; class Files { public static void main(String a[])throws IOException { int i,line=0,c=0,len; char k; boolean m; File f=new File("info.txt"); FileInputStream f1=new FileInputStream("info.txt"); len=f1.available(); for(i=0;i<=len;i++) { k=(char)f1.read(); c++; System.out.print(k); if(k='/n') { line++; System.out.println(+line); } } System.out.print("number of characters="+c); } }
Active file: An active file is where you use a file quite frequently. Inactive file: A file that you use but not as frequently. Dead file: A dead file is where you don't use the file at all and is stored in your archives
A project file is a file which contains information about your program. This could include source code, resources (images, sounds, etc.), and configuration files. A data file is a file which is actually used by your program to persist data between sessions.
First of all, these two classes are on different levels of abstraction. An InputStream is used for reading any stream of bytes, while a FileReader is used to read characters from a file. If you want to ask between a FileInputStream and a FileReader, then we need to look at what type of data you are reading. If you're reading plain-text file, for example, you want to use a FileReader because it was designed to read in characters. For other types of data, the FileInputStream would be better, as it is used to read in generic streams of bytes from a file.
These streams are classified as mode streams as they read and write data from disk files. the classes associated with these streams have constructos that allows us to specify the path of the file to which they are connected. The FileInputStream class allows us to read input from a file in the form of a stream. The FileOutputStream class allows us to write output to a file stream. Example, FileInputStream inputfile = new FileInputStream ("Empolyee.dat"); FileOutputStream outputfile = new FileOutputStream ("binus.dat");
difference between a form file and a form.
what is the differences between a file and a folder
The difference between a cherry file cabinet and a normal file cabinet is the finish of the wood. Cherry file cabinets have a deep brownish-red finish.
trdfx5tdifyibh cv5yhtn097g
no difference! (ddduuuhhh!), unless it a online file
The difference between an open file format and a proprietary file format is the ability to share. Open formats make sharing between computers easier.
A file for metal needs to be harder and the teeth need to be finer.
what is the difference between a file server and a internet service provider
Rank is shoulder to shoulder, file is one behind another.
import java.io.*; class Files { public static void main(String a[])throws IOException { int i,line=0,c=0,len; char k; boolean m; File f=new File("info.txt"); FileInputStream f1=new FileInputStream("info.txt"); len=f1.available(); for(i=0;i<=len;i++) { k=(char)f1.read(); c++; System.out.print(k); if(k='/n') { line++; System.out.println(+line); } } System.out.print("number of characters="+c); } }