answersLogoWhite

0


Best Answer

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,.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between File Reader and FileInputStream in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

To read data which is superior 1. input stream 2. file reader?

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.


What are the uses of File Input Stream and File Output Stream in java programming?

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");


Java program that reads a file and display the file on the screen with a line number before each line?

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); } }


What is the difference between an inactive file and dead file?

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


What is the difference between data file and project file in vb 6.0?

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.

Related questions

To read data which is superior 1. input stream 2. file reader?

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.


What are the uses of File Input Stream and File Output Stream in java programming?

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");


What is the difference between a form file object and a windows form object?

difference between a form file and a form.


Difference between file and folder in dos commands?

what is the differences between a file and a folder


What is the difference between a cherry file cabinet and a normal file cabinet?

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.


What is the difference between a DIR file and EXE file in director?

trdfx5tdifyibh cv5yhtn097g


What the differences between file and folder?

no difference! (ddduuuhhh!), unless it a online file


What is the difference an open file format and a proprietary file format?

The difference between an open file format and a proprietary file format is the ability to share. Open formats make sharing between computers easier.


What is the difference between a wood file and a metal file?

A file for metal needs to be harder and the teeth need to be finer.


What is the difference between service provider and network provider?

what is the difference between a file server and a internet service provider


What is the difference between rank and file?

Rank is shoulder to shoulder, file is one behind another.


Java program that reads a file and display the file on the screen with a line number before each line?

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); } }