ZipFile zip
、そのZipEntry entry
、およびターゲットFile が与えられた場合、unzippedEntryFile
最も読みやすい書き込み方法は何entry
ですかunzippedEntryFile
?
Google GuavaとApache.Commons.IOを使用して、次のソリューションを思いつきました。
InputSupplier<ByteArrayInputStream> entryInputSupplier = ByteStreams.newInputStreamSupplier(IOUtils.toByteArray(zip.getInputStream(entry)));
Files.copy(entryInputSupplier, unzippedEntryFile);
ただし、もっと簡単にできることがわかります。
ありがとう、
コンラッド