Classification of streams
1. by Direction : input stream and output stream
2. by Type : byte stream and character stream
3. by operation mode : node stream and filter stream
4. Conversion Flow
Package Stream;
Import Java.io.FileInputStream;
Import java.io.FileNotFoundException;
Import java.io.IOException;
public class FileOutputStream {
public static void Main (string[] args) {
FileInputStream Fis=null;
FileOutputStream Fos=null;
try {
Fis=new FileInputStream ("g:\\ picture \\one. JPG ");
Fos=new FileOutputStream ("d:\\temp\\two.jpg");
byte buf[]=new byte[1024];
int len=0;
while ((Len=fis.read (BUF)) >0) {
System.out.write (BUF);
}
} catch (FileNotFoundException e) {
E.printstacktrace ();
} catch (IOException e) {
E.printstacktrace ();
}finally{
if (fis!=null)
try {
Fis.close ();
} catch (IOException e) {
E.printstacktrace ();
}
if (fos!=null)
try {
Fos.close ();
} catch (IOException e) {
E.printstacktrace ();
}
}
}
}
Classification of Java_io_fileoutstream and streams