Switch to full style
General Java code examples
Post a reply

Copy file to file in java code- implementation

Wed Feb 06, 2013 8:03 pm

Copy file to file in java implementation
java code
import java.io.*;

public class CopyBytes {
public static void main(String[] args) throws IOException {
File inputFile = new File("f1.txt");
File outputFile = new File("f2.txt");

FileInputStream in = new FileInputStream(inputFile);
FileOutputStream out = new FileOutputStream(outputFile);
int c;

while ((c = in.read()) != -1)
out.write(c);

in.close();
out.close();
}
}




Post a reply
  Related Posts  to : Copy file to file in java code- implementation
 copy file     -  
 moving file with copy() function in php     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 quicksort algorithm implementation java code- array sorting     -  
 Upload PHP file code     -  
 Bubble Sort Algorithm Java Implementation Code-Sorting Array     -  
 location of a package statement within a source code file     -  
 file descriptor vs file pointer     -  
 getting file name of html input file tag using jsp     -  
 Java File age monitoring     -  

Topic Tags

Java Files and I/O