티스토리 뷰
public static boolean createZipFile(String sourceFile, String createZip) throws IOException{
boolean result=true;
byte[] buf=new byte[1024];
try{
ZipOutputStream zipOut=new ZipOutputStream(new FileOutputStream(createZip));
File inFile=new File(sourceFile);
FileInputStream in=new FileInputStream(inFile);
zipOut.putNextEntry(new ZipEntry(inFile.getName()));
int len;
while((len=in.read(buf))>0){
zipOut.write(buf,0,len);
}
in.close();
zipOut.closeEntry();
zipOut.close();
result=true;
}catch(IOException e){
result=false;
e.printStackTrace();
}finally{
return result;
}
}
'자바(Java) > 자바UTIL' 카테고리의 다른 글
[자바] 문자에서 숫자 한글만 추출 (0) | 2018.10.23 |
---|
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- ocajp
- 프로씨
- ocjap
- 자바 smtp
- 스크래핑
- 문자열
- Python
- 파이썬
- xe addon
- EC
- JDBC
- xe애드온
- 오라클
- webix
- proc
- 파싱
- php
- esql
- KG
- C언어
- C
- 라이믹스 모듈
- 플러터
- 인포믹스
- 자바
- MySQL
- 이클립스
- XE3
- 포인터
- XE
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
글 보관함