Copy byte between FileInputStream and FileOutputStream : FileOutputStream « File Input Output « Java

Copy byte between FileInputStream and FileOutputStream



class Copy {
  public static void main(String[] args) throws Exception {
    FileInputStream fis = null;
    FileOutputStream fos = null;
    fis = new FileInputStream(args[0]);
    fos = new FileOutputStream(args[1]);

    int byte_;
    while ((byte_ = != -1)


Related examples in the same category

1.File IO
2.Copy Bytes between FileInputStream and FileOutputStream
3.Write byte array to a file using FileOutputStream
4.Create DataOutputStream from FileOutputStream
5.Write double to a file using DataOutputStream
6.Append output to file using FileOutputStream
7.Create FileOutputStream object from File object
8.Create FileOutputStream object from String file path
9.Write file using FileOutputStream
10.Use FileOutputStream to write the bytes to a file.
11.Write UTF String, integer and double with DataOutputStream
12.Write data with FileOutputStream
13.Split file
14.Rollover FileOutputStream