JAvaによるファイル圧縮




		FileOutputStream fos;
		FileInputStream foi;
		try {			
			foi=new FileInputStream("c:/68_20100116095413.xml");
			fos = new  FileOutputStream("c:/abc.zip");
			ZipOutputStream zipos=new ZipOutputStream(fos);
			zipos.putNextEntry(new ZipEntry("ddd.xml"));
			byte[] buffer = new byte[1024];
			int len = 0;
			while ((len = foi.read(buffer)) > 0) {
					zipos.write(buffer, 0, len);
			}			
			zipos.flush();
			zipos.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}