【初心者】Java質問・相談スレ�F【大歓迎】
■ このスレッドは過去ログ倉庫に格納されています
0602601
NGNGtry {
File readfile = new File( "c:/CM0001_download.csv" );
File zipFile = new File( "c:/CM0001_download.zip" );
BufferedInputStream bis = new BufferedInputStream( new FileInputStream( readfile ) );
ZipOutputStream zos = new ZipOutputStream( new FileOutputStream( zipFile ) );
ZipEntry entry = new ZipEntry( readfile.getPath() );
zos.putNextEntry( entry ); // entry の書き込み開始
byte buf[] = new byte[1024];
int count = 0;
while( ( count = bis.read( buf, 0, 1024 ) ) != EOF ) {
zos.write( buf, 0, count );
}
bis.close();
zos.closeEntry(); // entry の書き込み終了
zos.close();
}
もしよろしかったらどこにどのように組み込めば
いいか教えて頂けると幸いです・・・
■ このスレッドは過去ログ倉庫に格納されています