\
2021.03.29 - [JAVA/JAVA(자바)설치 및 툴 이용(ECLIPSE)] - [JAVA] 자바 설치 및 환경 하기 JDK 1.8 버전
[JAVA] 자바 설치 및 환경 하기 JDK 1.8 버전
www.oracle.com/kr/java/technologies/javase/javase-jdk8-downloads.html 위 링크 클릭 하면 여기로 온다 각자의 환경에 맞게 설치 하자 나는 윈도우 64 비트 그전 오라클 로그인 필수 1. 다운로든 된거를 실행..
marine1188.tistory.com
개발 환경
Window 10
JDK 1.8
이클립스 2020_03 버전
배열을 사용하여 속도를 올릴수있다
package ex04.file;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
public class FileCopy_array {
public static void main(String[] args) throws Exception {
//빠르게 하기 위해서
//경로 설정만 잘하자
//읽기 객체 - FileInputStream
InputStream is = new FileInputStream("읽을 주소 입력");
//쓰기 객체 - FileOutputStream
OutputStream os = new FileOutputStream("쓰여질 주소 입력");
//싹 간다// 배열의 크기
byte[] buffer = new byte[1024 * 8];
long start = System.currentTimeMillis();//시작 시간 저장
while(true) {
int inputData = is.read();
if( inputData == -1 ) break;
//100개씩 담으니 읽을 때는 한번에 읽어줘//그릇의 크기만금 써라
os.write(buffer,0,inputData);
}
long end = System.currentTimeMillis();//끝난 시간 저장
System.out.println(end - start);
is.close(); os.close();
System.out.println("copy success!!!");
}
}