0% found this document useful (0 votes)
10 views

Program No:-7: Objective:-Tool: - Code

Uploaded by

ARPIT AGARWAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Program No:-7: Objective:-Tool: - Code

Uploaded by

ARPIT AGARWAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Program no:-7

Objective:- Write a program that write 5 integers on file using ByteStream


Tool:-JDK
Code:-
import java.io.FileInputStreams;
public class ReadingUsingByteStreamDemo1
{
public static void main(String args[]) {
try
{
FileInputStream fis = new FileInputStream("gla.txt");
int data=1;
System.out.print("\n The content of file is \n");
while(data != -1) // -1 is for EOF End of file
{
data = fis.read();
char chardata = (char)data;
if(data != -1)
System.out.print(chardata);
}
}
catch(Exception e) {}
}
}
Output:-

You might also like