티스토리 뷰
public class FileCopy { public static void main(String[] args) { try { Path from = Paths.get("c:/Temp/dir/house.jpg"); Path to = Paths.get("c:/Temp/dir/house2.jpg"); FileChannel fcFrom = FileChannel.open(from, StandardOpenOption.READ); FileChannel fcTo = FileChannel.open(to, StandardOpenOption.CREATE, StandardOpenOption.WRITE); ByteBuffer bb = ByteBuffer.allocateDirect(1024); int byteCount; while (true) { bb.clear(); byteCount = fcFrom.read(bb); if (byteCount == -1)break; bb.flip(); fcTo.write(bb); } fcFrom.close(); fcTo.close(); System.out.println("파일 복사 성공!"); } catch (Exception e) { System.out.println("error!"); } } }
'배움과 복습' 카테고리의 다른 글
이클립스에서 만들어진 프로젝트 배포 (0) | 2017.11.13 |
---|---|
JDBC에서 오라클의 커서를 사용하는 방법 (0) | 2017.10.20 |
in java 스레드에 대해 알아야할 것 세 가지 (0) | 2017.09.15 |
객체 입출력 보조 스트림 (0) | 2017.09.13 |
클래스명 뒤에 Dao, Vo, Dto 등을 붙이는 이유 (0) | 2017.09.12 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 복수행 함수
- tables in htmll
- Interface
- NVL2()
- 로컬 클래스
- Generic Type
- SQL Operator
- DI(의존성 주입)
- 멤버 클래스
- 테이블 데이터 복사
- 상속
- !(not)
- DECODE()
- FileChannel
- 타입변환과 다형성
- NVL()
- MONTH_BETWEEN
- casring
- hierarchical query
- CLASS
- Maven Project
- IN(var1 var2 var3)
- IS RECORD
- z-dindex
- 데이터 딕셔너리
- implements
- 계층형 쿼리
- GROUP BY절
- 중첩 클래스
- SELECT절 명령어
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함