-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfileInputOutputStream.java
More file actions
34 lines (31 loc) · 1.02 KB
/
fileInputOutputStream.java
File metadata and controls
34 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**@author SarthakRastogi
*
**/
import java.io.*;
// the program is for copying text from one file and pasting it
// into other file in lowercase letters.
public class fileInputOutputStream {
public static void main(String [] arg) throws Exception
{
try
{
FileInputStream fis = new FileInputStream("Source1.txt");
FileOutputStream fos = new FileOutputStream("Source2.txt");
//SequenceInputStream sis = new SequenceInputStream(fis1 , fis2);
//FileOutputStream fos = new FileOutputStream("destination.txt")
int b;
while((b=fis.read())!=-1)//reading
{
if(b>=65&&b<=120) fos.write(b+32);//copying
else fos.write(b);//copying
//fos.write(b);
}
fis.close();
fos.close();
}
catch(Exception e)
{
System.out.println(e);
}
}
}