달력

4

« 2024/4 »

  • 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

public class FileCopy {

public static void fileCopy(String input, String output){

FileInputStream fis = null;

FileOutputStream fos = null;

int i;

try{

fis = new FileInputStream(input);

fos = new FileOutputStream(output);

while((i = fis.read()) != -1){

fos.write(i);

}

}catch(IOException e){

e.printStackTrace();

}finally{

try{fis.close();}catch(IOException e){e.printStackTrace();}

try{fos.close();}catch(IOException e){e.printStackTrace();}

}

}


public static void main(String[] args) {

fileCopy("input.png", "output.png");

}

}

:
Posted by 클레잇