package Study;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;

public class FileControl {

	private FileOutputStream fos = null;
	private FileInputStream fis = null;

	private FileReader fr = null;
	private FileWriter fw = null;
	
	
	public void fileInputOutputStream(String readPoint, String fileName, String savePoint){
		
		int dump;
			
		try{
		
			fis = new FileInputStream(readPoint + fileName);

			
			fos = new FileOutputStream(savePoint + fileName);
			
			
			while( (dump = fis.read()) != -1){
				
				fos.write(dump);
				
			} // while end;
			
		}catch(Exception e){
			
			e.printStackTrace();
		
		}finally{
			
			closeDoor();
		} 
		
	}// fileMan() end;
	
	
	
	
	public void fileReaderWriter(String readPoint, String fileName, String savePoint){
		
		int dump;
		
		try{
		
			fr = new FileReader(readPoint + fileName);
			
			fw = new FileWriter(savePoint + fileName);
		
			while( (dump = fr.read()) != -1){
				
				fw.write(dump);
								
			}
				
		}catch(Exception e){
			
			e.printStackTrace();
			
		}finally{
			
			closeDoor();
			
		}
	} // fileReaderWriter() end;
	
	
	
	public void closeDoor(){
		

		if(fos != null){
			
			try{
				fos.close();
			}catch(Exception e){}
			
		}
		
		if(fis != null){
			
			try{
				fis.close();
			}catch(Exception e){}
			
		}
		
	} // closeDoor() end;
		
}


YOUR COMMENT IS THE CRITICAL SUCCESS FACTOR FOR THE QUALITY OF BLOG POST