question: private static void addFileToZip ( File srcFile , ZipOutputStream zip ) { byte [ ] buf = new byte [ 1024 ] ; int len ; FileInputStream in = null ; try { in = new FileInputStream ( srcFile ) ; while ( ( len = in . read ( buf ) ) > 0 ) { zip . write ( buf , 0 , len ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { close ( in ) ; } }
target:  Add file to zip archive