public static void extractFile ( final ZipInputStream in , final File outdir , final String name ) throws IOException { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; BufferedOutputStream out = new BufferedOutputStream ( new FileOutputStream ( new File ( outdir , name ) ) ) ; int count = - 1 ; while ( ( count = in . read ( buffer ) ) != - 1 ) { out . write ( buffer , 0 , count ) ; } out . close ( ) ; }
Extracts a single file from a zip archive .