public void copy(File targetFile) throws IOException {
		Files.mkdirs(targetFile);
		// file output stream is created in overwrite mode
		OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(targetFile));
		try {
			byte[] buffer = new byte[BUFFER_SIZE];
			for (;;) {
				int bytesRead = this.filesArchive.read(buffer);
				if (bytesRead <= 0) {
					break;
				}
				outputStream.write(buffer, 0, bytesRead);
			}
		} finally {
			Files.close(outputStream);
		}
	}
public void copy ( File targetFile ) throws IOException { Files . mkdirs ( targetFile ) ; OutputStream outputStream = new BufferedOutputStream ( new FileOutputStream ( targetFile ) ) ; try { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; for ( ; ; ) { int bytesRead = this . filesArchive . read ( buffer ) ; if ( bytesRead <= 0 ) { break ; } outputStream . write ( buffer , 0 , bytesRead ) ; } } finally { Files . close ( outputStream ) ; } }
Utility method that copy current ZIP entry to output file. This method is designed to work in conjunction with
{@link FilesIterator} that takes care to update current ZIP entry. Usage pattern is in sample code; trying to use it in
different contexts has not predictable results.

<pre>
for (File file : files) {
File targetFile = new File(targetDir, file.getPath());
files.copy(targetFile);
}
</pre>

Files input stream - <code>files</code> is iterated using for each loop. For every source <code>file</code> create
related <code>targetFile</code> and enact files input stream to self copy its current entry to target file. Note that
this method ensure target file parent directories are created. Also this method works in overwrite mode, that is, if
target file already exist it will be overwritten and old content lost.
<p>
Warning: do not use {@link Files#copy(InputStream, OutputStream)}; it closes both input and output streams and trying to
get ZIP next entry after that will fail with <em>stream closed</em> exception.

@param targetFile target file.
@throws IOException if read/write operation fails.