ZipArchiveOutputStream.html 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="de">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>ZipArchiveOutputStream (Apache Commons Compress 1.13 API)</title>
  7. <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
  8. </head>
  9. <body>
  10. <script type="text/javascript"><!--
  11. try {
  12. if (location.href.indexOf('is-external=true') == -1) {
  13. parent.document.title="ZipArchiveOutputStream (Apache Commons Compress 1.13 API)";
  14. }
  15. }
  16. catch(err) {
  17. }
  18. //-->
  19. </script>
  20. <noscript>
  21. <div>JavaScript is disabled on your browser.</div>
  22. </noscript>
  23. <!-- ========= START OF TOP NAVBAR ======= -->
  24. <div class="topNav"><a name="navbar_top">
  25. <!-- -->
  26. </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
  27. <!-- -->
  28. </a>
  29. <ul class="navList" title="Navigation">
  30. <li><a href="../../../../../../overview-summary.html">Overview</a></li>
  31. <li><a href="package-summary.html">Package</a></li>
  32. <li class="navBarCell1Rev">Class</li>
  33. <li><a href="class-use/ZipArchiveOutputStream.html">Use</a></li>
  34. <li><a href="package-tree.html">Tree</a></li>
  35. <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
  36. <li><a href="../../../../../../index-all.html">Index</a></li>
  37. <li><a href="../../../../../../help-doc.html">Help</a></li>
  38. </ul>
  39. </div>
  40. <div class="subNav">
  41. <ul class="navList">
  42. <li><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.html" title="class in org.apache.commons.compress.archivers.zip"><span class="strong">Prev Class</span></a></li>
  43. <li><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.UnicodeExtraFieldPolicy.html" title="class in org.apache.commons.compress.archivers.zip"><span class="strong">Next Class</span></a></li>
  44. </ul>
  45. <ul class="navList">
  46. <li><a href="../../../../../../index.html?org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html" target="_top">Frames</a></li>
  47. <li><a href="ZipArchiveOutputStream.html" target="_top">No Frames</a></li>
  48. </ul>
  49. <ul class="navList" id="allclasses_navbar_top">
  50. <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
  51. </ul>
  52. <div>
  53. <script type="text/javascript"><!--
  54. allClassesLink = document.getElementById("allclasses_navbar_top");
  55. if(window==top) {
  56. allClassesLink.style.display = "block";
  57. }
  58. else {
  59. allClassesLink.style.display = "none";
  60. }
  61. //-->
  62. </script>
  63. </div>
  64. <div>
  65. <ul class="subNavList">
  66. <li>Summary:&nbsp;</li>
  67. <li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
  68. <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
  69. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  70. <li><a href="#method_summary">Method</a></li>
  71. </ul>
  72. <ul class="subNavList">
  73. <li>Detail:&nbsp;</li>
  74. <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
  75. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  76. <li><a href="#method_detail">Method</a></li>
  77. </ul>
  78. </div>
  79. <a name="skip-navbar_top">
  80. <!-- -->
  81. </a></div>
  82. <!-- ========= END OF TOP NAVBAR ========= -->
  83. <!-- ======== START OF CLASS DATA ======== -->
  84. <div class="header">
  85. <div class="subTitle">org.apache.commons.compress.archivers.zip</div>
  86. <h2 title="Class ZipArchiveOutputStream" class="title">Class ZipArchiveOutputStream</h2>
  87. </div>
  88. <div class="contentContainer">
  89. <ul class="inheritance">
  90. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  91. <li>
  92. <ul class="inheritance">
  93. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">java.io.OutputStream</a></li>
  94. <li>
  95. <ul class="inheritance">
  96. <li><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">org.apache.commons.compress.archivers.ArchiveOutputStream</a></li>
  97. <li>
  98. <ul class="inheritance">
  99. <li>org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream</li>
  100. </ul>
  101. </li>
  102. </ul>
  103. </li>
  104. </ul>
  105. </li>
  106. </ul>
  107. <div class="description">
  108. <ul class="blockList">
  109. <li class="blockList">
  110. <dl>
  111. <dt>All Implemented Interfaces:</dt>
  112. <dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></dd>
  113. </dl>
  114. <dl>
  115. <dt>Direct Known Subclasses:</dt>
  116. <dd><a href="../../../../../../org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers.jar">JarArchiveOutputStream</a></dd>
  117. </dl>
  118. <hr>
  119. <br>
  120. <pre>public class <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.82">ZipArchiveOutputStream</a>
  121. extends <a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></pre>
  122. <div class="block">Reimplementation of <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/ZipOutputStream.html?is-external=true" title="class or interface in java.util.zip"><code>java.util.zip.ZipOutputStream</code></a> that does handle the extended
  123. functionality of this package, especially internal/external file
  124. attributes and extra fields with different layouts for local file
  125. data and central directory entries.
  126. <p>This class will try to use <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SeekableByteChannel.html?is-external=true" title="class or interface in java.nio.channels"><code>SeekableByteChannel</code></a> when it knows that the
  127. output is going to go to a file.</p>
  128. <p>If SeekableByteChannel cannot be used, this implementation will use
  129. a Data Descriptor to store size and CRC information for <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#DEFLATED"><code>DEFLATED</code></a> entries, this means, you don't need to
  130. calculate them yourself. Unfortunately this is not possible for
  131. the <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#STORED"><code>STORED</code></a> method, here setting the CRC and
  132. uncompressed size information is required before <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(ArchiveEntry)</code></a> can be called.</p>
  133. <p>As of Apache Commons Compress 1.3 it transparently supports Zip64
  134. extensions and thus individual entries and archives larger than 4
  135. GB or with more than 65536 entries in most cases but explicit
  136. control is provided via <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)"><code>setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)</code></a>. If the stream can not
  137. use SeekableByteChannel and you try to write a ZipArchiveEntry of
  138. unknown size then Zip64 extensions will be disabled by default.</p></div>
  139. <dl><dt><span class="strong">This class is not thread-safe</span></dt>
  140. <dd></dd></dl>
  141. </li>
  142. </ul>
  143. </div>
  144. <div class="summary">
  145. <ul class="blockList">
  146. <li class="blockList">
  147. <!-- ======== NESTED CLASS SUMMARY ======== -->
  148. <ul class="blockList">
  149. <li class="blockList"><a name="nested_class_summary">
  150. <!-- -->
  151. </a>
  152. <h3>Nested Class Summary</h3>
  153. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
  154. <caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
  155. <tr>
  156. <th class="colFirst" scope="col">Modifier and Type</th>
  157. <th class="colLast" scope="col">Class and Description</th>
  158. </tr>
  159. <tr class="altColor">
  160. <td class="colFirst"><code>static class&nbsp;</code></td>
  161. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.UnicodeExtraFieldPolicy.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveOutputStream.UnicodeExtraFieldPolicy</a></strong></code>
  162. <div class="block">enum that represents the possible policies for creating Unicode
  163. extra fields.</div>
  164. </td>
  165. </tr>
  166. </table>
  167. </li>
  168. </ul>
  169. <!-- =========== FIELD SUMMARY =========== -->
  170. <ul class="blockList">
  171. <li class="blockList"><a name="field_summary">
  172. <!-- -->
  173. </a>
  174. <h3>Field Summary</h3>
  175. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
  176. <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
  177. <tr>
  178. <th class="colFirst" scope="col">Modifier and Type</th>
  179. <th class="colLast" scope="col">Field and Description</th>
  180. </tr>
  181. <tr class="altColor">
  182. <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Deflater.html?is-external=true" title="class or interface in java.util.zip">Deflater</a></code></td>
  183. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#def">def</a></strong></code>
  184. <div class="block">This Deflater object is used for output.</div>
  185. </td>
  186. </tr>
  187. <tr class="rowColor">
  188. <td class="colFirst"><code>static int</code></td>
  189. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#DEFAULT_COMPRESSION">DEFAULT_COMPRESSION</a></strong></code>
  190. <div class="block">Default compression level for deflated entries.</div>
  191. </td>
  192. </tr>
  193. <tr class="altColor">
  194. <td class="colFirst"><code>static int</code></td>
  195. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#DEFLATED">DEFLATED</a></strong></code>
  196. <div class="block">Compression method for deflated entries.</div>
  197. </td>
  198. </tr>
  199. <tr class="rowColor">
  200. <td class="colFirst"><code>static int</code></td>
  201. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#EFS_FLAG">EFS_FLAG</a></strong></code>
  202. <div class="block"><strong>Deprecated.</strong>&nbsp;
  203. <div class="block"><i>use <a href="../../../../../../org/apache/commons/compress/archivers/zip/GeneralPurposeBit.html#UFT8_NAMES_FLAG"><code>GeneralPurposeBit.UFT8_NAMES_FLAG</code></a> instead</i></div>
  204. </div>
  205. </td>
  206. </tr>
  207. <tr class="altColor">
  208. <td class="colFirst"><code>protected boolean</code></td>
  209. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#finished">finished</a></strong></code>
  210. <div class="block">indicates if this archive is finished. protected for use in Jar implementation</div>
  211. </td>
  212. </tr>
  213. <tr class="rowColor">
  214. <td class="colFirst"><code>static int</code></td>
  215. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#STORED">STORED</a></strong></code>
  216. <div class="block">Compression method for stored entries.</div>
  217. </td>
  218. </tr>
  219. </table>
  220. </li>
  221. </ul>
  222. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  223. <ul class="blockList">
  224. <li class="blockList"><a name="constructor_summary">
  225. <!-- -->
  226. </a>
  227. <h3>Constructor Summary</h3>
  228. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  229. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  230. <tr>
  231. <th class="colOne" scope="col">Constructor and Description</th>
  232. </tr>
  233. <tr class="altColor">
  234. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#ZipArchiveOutputStream(java.io.File)">ZipArchiveOutputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</code>
  235. <div class="block">Creates a new ZIP OutputStream writing to a File.</div>
  236. </td>
  237. </tr>
  238. <tr class="rowColor">
  239. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#ZipArchiveOutputStream(java.io.OutputStream)">ZipArchiveOutputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;out)</code>
  240. <div class="block">Creates a new ZIP OutputStream filtering the underlying stream.</div>
  241. </td>
  242. </tr>
  243. <tr class="altColor">
  244. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#ZipArchiveOutputStream(java.nio.channels.SeekableByteChannel)">ZipArchiveOutputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SeekableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">SeekableByteChannel</a>&nbsp;channel)</code>
  245. <div class="block">Creates a new ZIP OutputStream writing to a SeekableByteChannel.</div>
  246. </td>
  247. </tr>
  248. </table>
  249. </li>
  250. </ul>
  251. <!-- ========== METHOD SUMMARY =========== -->
  252. <ul class="blockList">
  253. <li class="blockList"><a name="method_summary">
  254. <!-- -->
  255. </a>
  256. <h3>Method Summary</h3>
  257. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  258. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  259. <tr>
  260. <th class="colFirst" scope="col">Modifier and Type</th>
  261. <th class="colLast" scope="col">Method and Description</th>
  262. </tr>
  263. <tr class="altColor">
  264. <td class="colFirst"><code>void</code></td>
  265. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#addRawArchiveEntry(org.apache.commons.compress.archivers.zip.ZipArchiveEntry,%20java.io.InputStream)">addRawArchiveEntry</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;entry,
  266. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;rawStream)</code>
  267. <div class="block">Adds an archive entry with a raw input stream.</div>
  268. </td>
  269. </tr>
  270. <tr class="rowColor">
  271. <td class="colFirst"><code>boolean</code></td>
  272. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#canWriteEntryData(org.apache.commons.compress.archivers.ArchiveEntry)">canWriteEntryData</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;ae)</code>
  273. <div class="block">Whether this stream is able to write the given entry.</div>
  274. </td>
  275. </tr>
  276. <tr class="altColor">
  277. <td class="colFirst"><code>void</code></td>
  278. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#close()">close</a></strong>()</code>
  279. <div class="block">Closes this output stream and releases any system resources
  280. associated with the stream.</div>
  281. </td>
  282. </tr>
  283. <tr class="rowColor">
  284. <td class="colFirst"><code>void</code></td>
  285. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#closeArchiveEntry()">closeArchiveEntry</a></strong>()</code>
  286. <div class="block">Writes all necessary data for this entry.</div>
  287. </td>
  288. </tr>
  289. <tr class="altColor">
  290. <td class="colFirst"><code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a></code></td>
  291. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#createArchiveEntry(java.io.File,%20java.lang.String)">createArchiveEntry</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;inputFile,
  292. <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;entryName)</code>
  293. <div class="block">Creates a new zip entry taking some information from the given
  294. file and using the provided name.</div>
  295. </td>
  296. </tr>
  297. <tr class="rowColor">
  298. <td class="colFirst"><code>protected void</code></td>
  299. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#deflate()">deflate</a></strong>()</code>
  300. <div class="block">Writes next block of compressed data to the output stream.</div>
  301. </td>
  302. </tr>
  303. <tr class="altColor">
  304. <td class="colFirst"><code>void</code></td>
  305. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#finish()">finish</a></strong>()</code>
  306. <div class="block">Finishes the addition of entries to this stream, without closing it.</div>
  307. </td>
  308. </tr>
  309. <tr class="rowColor">
  310. <td class="colFirst"><code>void</code></td>
  311. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#flush()">flush</a></strong>()</code>
  312. <div class="block">Flushes this output stream and forces any buffered output bytes
  313. to be written out to the stream.</div>
  314. </td>
  315. </tr>
  316. <tr class="altColor">
  317. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  318. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#getEncoding()">getEncoding</a></strong>()</code>
  319. <div class="block">The encoding to use for filenames and the file comment.</div>
  320. </td>
  321. </tr>
  322. <tr class="rowColor">
  323. <td class="colFirst"><code>boolean</code></td>
  324. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#isSeekable()">isSeekable</a></strong>()</code>
  325. <div class="block">This method indicates whether this archive is writing to a
  326. seekable stream (i.e., to a random access file).</div>
  327. </td>
  328. </tr>
  329. <tr class="altColor">
  330. <td class="colFirst"><code>void</code></td>
  331. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)">putArchiveEntry</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;archiveEntry)</code>
  332. <div class="block">Writes the headers for an archive entry to the output stream.</div>
  333. </td>
  334. </tr>
  335. <tr class="rowColor">
  336. <td class="colFirst"><code>void</code></td>
  337. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setComment(java.lang.String)">setComment</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;comment)</code>
  338. <div class="block">Set the file comment.</div>
  339. </td>
  340. </tr>
  341. <tr class="altColor">
  342. <td class="colFirst"><code>void</code></td>
  343. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setCreateUnicodeExtraFields(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.UnicodeExtraFieldPolicy)">setCreateUnicodeExtraFields</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.UnicodeExtraFieldPolicy.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveOutputStream.UnicodeExtraFieldPolicy</a>&nbsp;b)</code>
  344. <div class="block">Whether to create Unicode Extra Fields.</div>
  345. </td>
  346. </tr>
  347. <tr class="rowColor">
  348. <td class="colFirst"><code>void</code></td>
  349. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setEncoding(java.lang.String)">setEncoding</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encoding)</code>
  350. <div class="block">The encoding to use for filenames and the file comment.</div>
  351. </td>
  352. </tr>
  353. <tr class="altColor">
  354. <td class="colFirst"><code>void</code></td>
  355. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setFallbackToUTF8(boolean)">setFallbackToUTF8</a></strong>(boolean&nbsp;b)</code>
  356. <div class="block">Whether to fall back to UTF and the language encoding flag if
  357. the file name cannot be encoded using the specified encoding.</div>
  358. </td>
  359. </tr>
  360. <tr class="rowColor">
  361. <td class="colFirst"><code>void</code></td>
  362. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setLevel(int)">setLevel</a></strong>(int&nbsp;level)</code>
  363. <div class="block">Sets the compression level for subsequent entries.</div>
  364. </td>
  365. </tr>
  366. <tr class="altColor">
  367. <td class="colFirst"><code>void</code></td>
  368. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setMethod(int)">setMethod</a></strong>(int&nbsp;method)</code>
  369. <div class="block">Sets the default compression method for subsequent entries.</div>
  370. </td>
  371. </tr>
  372. <tr class="rowColor">
  373. <td class="colFirst"><code>void</code></td>
  374. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseLanguageEncodingFlag(boolean)">setUseLanguageEncodingFlag</a></strong>(boolean&nbsp;b)</code>
  375. <div class="block">Whether to set the language encoding flag if the file name
  376. encoding is UTF-8.</div>
  377. </td>
  378. </tr>
  379. <tr class="altColor">
  380. <td class="colFirst"><code>void</code></td>
  381. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)">setUseZip64</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html" title="enum in org.apache.commons.compress.archivers.zip">Zip64Mode</a>&nbsp;mode)</code>
  382. <div class="block">Whether Zip64 extensions will be used.</div>
  383. </td>
  384. </tr>
  385. <tr class="rowColor">
  386. <td class="colFirst"><code>void</code></td>
  387. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#write(byte[],%20int,%20int)">write</a></strong>(byte[]&nbsp;b,
  388. int&nbsp;offset,
  389. int&nbsp;length)</code>
  390. <div class="block">Writes bytes to ZIP entry.</div>
  391. </td>
  392. </tr>
  393. <tr class="altColor">
  394. <td class="colFirst"><code>protected void</code></td>
  395. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeCentralDirectoryEnd()">writeCentralDirectoryEnd</a></strong>()</code>
  396. <div class="block">Writes the &quot;End of central dir record&quot;.</div>
  397. </td>
  398. </tr>
  399. <tr class="rowColor">
  400. <td class="colFirst"><code>protected void</code></td>
  401. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeCentralFileHeader(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)">writeCentralFileHeader</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;ze)</code>
  402. <div class="block">Writes the central file header entry.</div>
  403. </td>
  404. </tr>
  405. <tr class="altColor">
  406. <td class="colFirst"><code>protected void</code></td>
  407. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeDataDescriptor(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)">writeDataDescriptor</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;ze)</code>
  408. <div class="block">Writes the data descriptor entry.</div>
  409. </td>
  410. </tr>
  411. <tr class="rowColor">
  412. <td class="colFirst"><code>protected void</code></td>
  413. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeLocalFileHeader(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)">writeLocalFileHeader</a></strong>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;ze)</code>
  414. <div class="block">Writes the local file header entry</div>
  415. </td>
  416. </tr>
  417. <tr class="altColor">
  418. <td class="colFirst"><code>protected void</code></td>
  419. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeOut(byte[])">writeOut</a></strong>(byte[]&nbsp;data)</code>
  420. <div class="block">Write bytes to output or random access file.</div>
  421. </td>
  422. </tr>
  423. <tr class="rowColor">
  424. <td class="colFirst"><code>protected void</code></td>
  425. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeOut(byte[],%20int,%20int)">writeOut</a></strong>(byte[]&nbsp;data,
  426. int&nbsp;offset,
  427. int&nbsp;length)</code>
  428. <div class="block">Write bytes to output or random access file.</div>
  429. </td>
  430. </tr>
  431. <tr class="altColor">
  432. <td class="colFirst"><code>protected void</code></td>
  433. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#writeZip64CentralDirectory()">writeZip64CentralDirectory</a></strong>()</code>
  434. <div class="block">Writes the &quot;ZIP64 End of central dir record&quot; and
  435. &quot;ZIP64 End of central dir locator&quot;.</div>
  436. </td>
  437. </tr>
  438. </table>
  439. <ul class="blockList">
  440. <li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.compress.archivers.ArchiveOutputStream">
  441. <!-- -->
  442. </a>
  443. <h3>Methods inherited from class&nbsp;org.apache.commons.compress.archivers.<a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></h3>
  444. <code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#count(int)">count</a>, <a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#count(long)">count</a>, <a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#getBytesWritten()">getBytesWritten</a>, <a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#getCount()">getCount</a>, <a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#write(int)">write</a></code></li>
  445. </ul>
  446. <ul class="blockList">
  447. <li class="blockList"><a name="methods_inherited_from_class_java.io.OutputStream">
  448. <!-- -->
  449. </a>
  450. <h3>Methods inherited from class&nbsp;java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></h3>
  451. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#write(byte[])" title="class or interface in java.io">write</a></code></li>
  452. </ul>
  453. <ul class="blockList">
  454. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  455. <!-- -->
  456. </a>
  457. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  458. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
  459. </ul>
  460. </li>
  461. </ul>
  462. </li>
  463. </ul>
  464. </div>
  465. <div class="details">
  466. <ul class="blockList">
  467. <li class="blockList">
  468. <!-- ============ FIELD DETAIL =========== -->
  469. <ul class="blockList">
  470. <li class="blockList"><a name="field_detail">
  471. <!-- -->
  472. </a>
  473. <h3>Field Detail</h3>
  474. <a name="finished">
  475. <!-- -->
  476. </a>
  477. <ul class="blockList">
  478. <li class="blockList">
  479. <h4>finished</h4>
  480. <pre>protected&nbsp;boolean <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.115">finished</a></pre>
  481. <div class="block">indicates if this archive is finished. protected for use in Jar implementation</div>
  482. </li>
  483. </ul>
  484. <a name="DEFLATED">
  485. <!-- -->
  486. </a>
  487. <ul class="blockList">
  488. <li class="blockList">
  489. <h4>DEFLATED</h4>
  490. <pre>public static final&nbsp;int <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.120">DEFLATED</a></pre>
  491. <div class="block">Compression method for deflated entries.</div>
  492. <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../constant-values.html#org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.DEFLATED">Constant Field Values</a></dd></dl>
  493. </li>
  494. </ul>
  495. <a name="DEFAULT_COMPRESSION">
  496. <!-- -->
  497. </a>
  498. <ul class="blockList">
  499. <li class="blockList">
  500. <h4>DEFAULT_COMPRESSION</h4>
  501. <pre>public static final&nbsp;int <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.125">DEFAULT_COMPRESSION</a></pre>
  502. <div class="block">Default compression level for deflated entries.</div>
  503. <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../constant-values.html#org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.DEFAULT_COMPRESSION">Constant Field Values</a></dd></dl>
  504. </li>
  505. </ul>
  506. <a name="STORED">
  507. <!-- -->
  508. </a>
  509. <ul class="blockList">
  510. <li class="blockList">
  511. <h4>STORED</h4>
  512. <pre>public static final&nbsp;int <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.130">STORED</a></pre>
  513. <div class="block">Compression method for stored entries.</div>
  514. <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../constant-values.html#org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.STORED">Constant Field Values</a></dd></dl>
  515. </li>
  516. </ul>
  517. <a name="EFS_FLAG">
  518. <!-- -->
  519. </a>
  520. <ul class="blockList">
  521. <li class="blockList">
  522. <h4>EFS_FLAG</h4>
  523. <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
  524. public static final&nbsp;int <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.143">EFS_FLAG</a></pre>
  525. <div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>use <a href="../../../../../../org/apache/commons/compress/archivers/zip/GeneralPurposeBit.html#UFT8_NAMES_FLAG"><code>GeneralPurposeBit.UFT8_NAMES_FLAG</code></a> instead</i></div>
  526. <div class="block">General purpose flag, which indicates that filenames are
  527. written in UTF-8.</div>
  528. <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../constant-values.html#org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.EFS_FLAG">Constant Field Values</a></dd></dl>
  529. </li>
  530. </ul>
  531. <a name="def">
  532. <!-- -->
  533. </a>
  534. <ul class="blockListLast">
  535. <li class="blockList">
  536. <h4>def</h4>
  537. <pre>protected final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Deflater.html?is-external=true" title="class or interface in java.util.zip">Deflater</a> <a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.232">def</a></pre>
  538. <div class="block">This Deflater object is used for output.</div>
  539. </li>
  540. </ul>
  541. </li>
  542. </ul>
  543. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  544. <ul class="blockList">
  545. <li class="blockList"><a name="constructor_detail">
  546. <!-- -->
  547. </a>
  548. <h3>Constructor Detail</h3>
  549. <a name="ZipArchiveOutputStream(java.io.OutputStream)">
  550. <!-- -->
  551. </a>
  552. <ul class="blockList">
  553. <li class="blockList">
  554. <h4>ZipArchiveOutputStream</h4>
  555. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.272">ZipArchiveOutputStream</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;out)</pre>
  556. <div class="block">Creates a new ZIP OutputStream filtering the underlying stream.</div>
  557. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - the outputstream to zip</dd></dl>
  558. </li>
  559. </ul>
  560. <a name="ZipArchiveOutputStream(java.io.File)">
  561. <!-- -->
  562. </a>
  563. <ul class="blockList">
  564. <li class="blockList">
  565. <h4>ZipArchiveOutputStream</h4>
  566. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.285">ZipArchiveOutputStream</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)
  567. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  568. <div class="block">Creates a new ZIP OutputStream writing to a File. Will use
  569. random access if possible.</div>
  570. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the file to zip to</dd>
  571. <dt><span class="strong">Throws:</span></dt>
  572. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  573. </li>
  574. </ul>
  575. <a name="ZipArchiveOutputStream(java.nio.channels.SeekableByteChannel)">
  576. <!-- -->
  577. </a>
  578. <ul class="blockListLast">
  579. <li class="blockList">
  580. <h4>ZipArchiveOutputStream</h4>
  581. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.320">ZipArchiveOutputStream</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SeekableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">SeekableByteChannel</a>&nbsp;channel)
  582. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  583. <div class="block">Creates a new ZIP OutputStream writing to a SeekableByteChannel.
  584. <p><a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  585. allows you to write to an in-memory archive using random
  586. access.</p></div>
  587. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>channel</code> - the channel to zip to</dd>
  588. <dt><span class="strong">Throws:</span></dt>
  589. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd><dt><span class="strong">Since:</span></dt>
  590. <dd>1.13</dd></dl>
  591. </li>
  592. </ul>
  593. </li>
  594. </ul>
  595. <!-- ============ METHOD DETAIL ========== -->
  596. <ul class="blockList">
  597. <li class="blockList"><a name="method_detail">
  598. <!-- -->
  599. </a>
  600. <h3>Method Detail</h3>
  601. <a name="isSeekable()">
  602. <!-- -->
  603. </a>
  604. <ul class="blockList">
  605. <li class="blockList">
  606. <h4>isSeekable</h4>
  607. <pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.336">isSeekable</a>()</pre>
  608. <div class="block">This method indicates whether this archive is writing to a
  609. seekable stream (i.e., to a random access file).
  610. <p>For seekable streams, you don't need to calculate the CRC or
  611. uncompressed size for <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#STORED"><code>STORED</code></a> entries before
  612. invoking <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(ArchiveEntry)</code></a>.</div>
  613. <dl><dt><span class="strong">Returns:</span></dt><dd>true if seekable</dd></dl>
  614. </li>
  615. </ul>
  616. <a name="setEncoding(java.lang.String)">
  617. <!-- -->
  618. </a>
  619. <ul class="blockList">
  620. <li class="blockList">
  621. <h4>setEncoding</h4>
  622. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.349">setEncoding</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encoding)</pre>
  623. <div class="block">The encoding to use for filenames and the file comment.
  624. <p>For a list of possible values see <a
  625. href="http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html">http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html</a>.
  626. Defaults to UTF-8.</p></div>
  627. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>encoding</code> - the encoding to use for file names, use null
  628. for the platform's default encoding</dd></dl>
  629. </li>
  630. </ul>
  631. <a name="getEncoding()">
  632. <!-- -->
  633. </a>
  634. <ul class="blockList">
  635. <li class="blockList">
  636. <h4>getEncoding</h4>
  637. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.362">getEncoding</a>()</pre>
  638. <div class="block">The encoding to use for filenames and the file comment.</div>
  639. <dl><dt><span class="strong">Returns:</span></dt><dd>null if using the platform's default character encoding.</dd></dl>
  640. </li>
  641. </ul>
  642. <a name="setUseLanguageEncodingFlag(boolean)">
  643. <!-- -->
  644. </a>
  645. <ul class="blockList">
  646. <li class="blockList">
  647. <h4>setUseLanguageEncodingFlag</h4>
  648. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.375">setUseLanguageEncodingFlag</a>(boolean&nbsp;b)</pre>
  649. <div class="block">Whether to set the language encoding flag if the file name
  650. encoding is UTF-8.
  651. <p>Defaults to true.</p></div>
  652. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - whether to set the language encoding flag if the file
  653. name encoding is UTF-8</dd></dl>
  654. </li>
  655. </ul>
  656. <a name="setCreateUnicodeExtraFields(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.UnicodeExtraFieldPolicy)">
  657. <!-- -->
  658. </a>
  659. <ul class="blockList">
  660. <li class="blockList">
  661. <h4>setCreateUnicodeExtraFields</h4>
  662. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.386">setCreateUnicodeExtraFields</a>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.UnicodeExtraFieldPolicy.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveOutputStream.UnicodeExtraFieldPolicy</a>&nbsp;b)</pre>
  663. <div class="block">Whether to create Unicode Extra Fields.
  664. <p>Defaults to NEVER.</p></div>
  665. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - whether to create Unicode Extra Fields.</dd></dl>
  666. </li>
  667. </ul>
  668. <a name="setFallbackToUTF8(boolean)">
  669. <!-- -->
  670. </a>
  671. <ul class="blockList">
  672. <li class="blockList">
  673. <h4>setFallbackToUTF8</h4>
  674. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.400">setFallbackToUTF8</a>(boolean&nbsp;b)</pre>
  675. <div class="block">Whether to fall back to UTF and the language encoding flag if
  676. the file name cannot be encoded using the specified encoding.
  677. <p>Defaults to false.</p></div>
  678. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - whether to fall back to UTF and the language encoding
  679. flag if the file name cannot be encoded using the specified
  680. encoding.</dd></dl>
  681. </li>
  682. </ul>
  683. <a name="setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)">
  684. <!-- -->
  685. </a>
  686. <ul class="blockList">
  687. <li class="blockList">
  688. <h4>setUseZip64</h4>
  689. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.449">setUseZip64</a>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html" title="enum in org.apache.commons.compress.archivers.zip">Zip64Mode</a>&nbsp;mode)</pre>
  690. <div class="block">Whether Zip64 extensions will be used.
  691. <p>When setting the mode to <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Never</code></a>,
  692. <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)</code></a>, <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#closeArchiveEntry()"><code>closeArchiveEntry()</code></a>, <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#finish()"><code>finish()</code></a> or <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#close()"><code>close()</code></a> may throw a <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip"><code>Zip64RequiredException</code></a> if the entry's size or the total size
  693. of the archive exceeds 4GB or there are more than 65536 entries
  694. inside the archive. Any archive created in this mode will be
  695. readable by implementations that don't support Zip64.</p>
  696. <p>When setting the mode to <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Always"><code>Always</code></a>,
  697. Zip64 extensions will be used for all entries. Any archive
  698. created in this mode may be unreadable by implementations that
  699. don't support Zip64 even if all its contents would be.</p>
  700. <p>When setting the mode to <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#AsNeeded"><code>AsNeeded</code></a>, Zip64 extensions will transparently be used for
  701. those entries that require them. This mode can only be used if
  702. the uncompressed size of the <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip"><code>ZipArchiveEntry</code></a> is known
  703. when calling <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)</code></a> or the archive is written
  704. to a seekable output (i.e. you have used the <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#ZipArchiveOutputStream(java.io.File)"><code>File-arg constructor</code></a>) -
  705. this mode is not valid when the output stream is not seekable
  706. and the uncompressed size is unknown when <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)</code></a> is called.</p>
  707. <p>If no entry inside the resulting archive requires Zip64
  708. extensions then <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Never</code></a> will create the
  709. smallest archive. <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#AsNeeded"><code>AsNeeded</code></a> will
  710. create a slightly bigger archive if the uncompressed size of
  711. any entry has initially been unknown and create an archive
  712. identical to <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Never</code></a> otherwise. <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Always"><code>Always</code></a> will create an archive that is at
  713. least 24 bytes per entry bigger than the one <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Never</code></a> would create.</p>
  714. <p>Defaults to <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#AsNeeded"><code>AsNeeded</code></a> unless
  715. <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)</code></a> is called with an entry of unknown
  716. size and data is written to a non-seekable stream - in this
  717. case the default is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Never</code></a>.</p></div>
  718. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mode</code> - Whether Zip64 extensions will be used.</dd><dt><span class="strong">Since:</span></dt>
  719. <dd>1.3</dd></dl>
  720. </li>
  721. </ul>
  722. <a name="finish()">
  723. <!-- -->
  724. </a>
  725. <ul class="blockList">
  726. <li class="blockList">
  727. <h4>finish</h4>
  728. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.460">finish</a>()
  729. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  730. <div class="block">Finishes the addition of entries to this stream, without closing it.
  731. Additional data can be written, if the format supports it.</div>
  732. <dl>
  733. <dt><strong>Specified by:</strong></dt>
  734. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#finish()">finish</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></code></dd>
  735. <dt><span class="strong">Throws:</span></dt>
  736. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip">Zip64RequiredException</a></code> - if the archive's size exceeds 4
  737. GByte or there are more than 65535 entries inside the archive
  738. and <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)"><code>setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)</code></a> is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Zip64Mode.Never</code></a>.</dd>
  739. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if the user forgets to close the entry.</dd></dl>
  740. </li>
  741. </ul>
  742. <a name="closeArchiveEntry()">
  743. <!-- -->
  744. </a>
  745. <ul class="blockList">
  746. <li class="blockList">
  747. <h4>closeArchiveEntry</h4>
  748. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.504">closeArchiveEntry</a>()
  749. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  750. <div class="block">Writes all necessary data for this entry.</div>
  751. <dl>
  752. <dt><strong>Specified by:</strong></dt>
  753. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#closeArchiveEntry()">closeArchiveEntry</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></code></dd>
  754. <dt><span class="strong">Throws:</span></dt>
  755. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd>
  756. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip">Zip64RequiredException</a></code> - if the entry's uncompressed or
  757. compressed size exceeds 4 GByte and <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)"><code>setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)</code></a>
  758. is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Zip64Mode.Never</code></a>.</dd></dl>
  759. </li>
  760. </ul>
  761. <a name="addRawArchiveEntry(org.apache.commons.compress.archivers.zip.ZipArchiveEntry, java.io.InputStream)">
  762. <!-- -->
  763. </a>
  764. <ul class="blockList">
  765. <li class="blockList">
  766. <h4>addRawArchiveEntry</h4>
  767. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.572">addRawArchiveEntry</a>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;entry,
  768. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;rawStream)
  769. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  770. <div class="block">Adds an archive entry with a raw input stream.
  771. If crc, size and compressed size are supplied on the entry, these values will be used as-is.
  772. Zip64 status is re-established based on the settings in this stream, and the supplied value
  773. is ignored.
  774. The entry is put and closed immediately.</div>
  775. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>entry</code> - The archive entry to add</dd><dd><code>rawStream</code> - The raw input stream of a different entry. May be compressed/encrypted.</dd>
  776. <dt><span class="strong">Throws:</span></dt>
  777. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If copying fails</dd></dl>
  778. </li>
  779. </ul>
  780. <a name="putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)">
  781. <!-- -->
  782. </a>
  783. <ul class="blockList">
  784. <li class="blockList">
  785. <h4>putArchiveEntry</h4>
  786. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.724">putArchiveEntry</a>(<a href="../../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;archiveEntry)
  787. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  788. <div class="block">Writes the headers for an archive entry to the output stream.
  789. The caller must then write the content to the stream and call
  790. <a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#closeArchiveEntry()"><code>ArchiveOutputStream.closeArchiveEntry()</code></a> to complete the process.</div>
  791. <dl>
  792. <dt><strong>Specified by:</strong></dt>
  793. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)">putArchiveEntry</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></code></dd>
  794. <dt><span class="strong">Parameters:</span></dt><dd><code>archiveEntry</code> - describes the entry</dd>
  795. <dt><span class="strong">Throws:</span></dt>
  796. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if entry is not an instance of ZipArchiveEntry</dd>
  797. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip">Zip64RequiredException</a></code> - if the entry's uncompressed or
  798. compressed size is known to exceed 4 GByte and <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)"><code>setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)</code></a>
  799. is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Zip64Mode.Never</code></a>.</dd>
  800. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
  801. </li>
  802. </ul>
  803. <a name="setComment(java.lang.String)">
  804. <!-- -->
  805. </a>
  806. <ul class="blockList">
  807. <li class="blockList">
  808. <h4>setComment</h4>
  809. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.856">setComment</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;comment)</pre>
  810. <div class="block">Set the file comment.</div>
  811. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>comment</code> - the comment</dd></dl>
  812. </li>
  813. </ul>
  814. <a name="setLevel(int)">
  815. <!-- -->
  816. </a>
  817. <ul class="blockList">
  818. <li class="blockList">
  819. <h4>setLevel</h4>
  820. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.868">setLevel</a>(int&nbsp;level)</pre>
  821. <div class="block">Sets the compression level for subsequent entries.
  822. <p>Default is Deflater.DEFAULT_COMPRESSION.</p></div>
  823. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>level</code> - the compression level.</dd>
  824. <dt><span class="strong">Throws:</span></dt>
  825. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if an invalid compression
  826. level is specified.</dd></dl>
  827. </li>
  828. </ul>
  829. <a name="setMethod(int)">
  830. <!-- -->
  831. </a>
  832. <ul class="blockList">
  833. <li class="blockList">
  834. <h4>setMethod</h4>
  835. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.884">setMethod</a>(int&nbsp;method)</pre>
  836. <div class="block">Sets the default compression method for subsequent entries.
  837. <p>Default is DEFLATED.</p></div>
  838. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>method</code> - an <code>int</code> from java.util.zip.ZipEntry</dd></dl>
  839. </li>
  840. </ul>
  841. <a name="canWriteEntryData(org.apache.commons.compress.archivers.ArchiveEntry)">
  842. <!-- -->
  843. </a>
  844. <ul class="blockList">
  845. <li class="blockList">
  846. <h4>canWriteEntryData</h4>
  847. <pre>public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.896">canWriteEntryData</a>(<a href="../../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;ae)</pre>
  848. <div class="block">Whether this stream is able to write the given entry.
  849. <p>May return false if it is set up to use encryption or a
  850. compression method that hasn't been implemented yet.</p></div>
  851. <dl>
  852. <dt><strong>Overrides:</strong></dt>
  853. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#canWriteEntryData(org.apache.commons.compress.archivers.ArchiveEntry)">canWriteEntryData</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></code></dd>
  854. <dt><span class="strong">Parameters:</span></dt><dd><code>ae</code> - the entry to test</dd>
  855. <dt><span class="strong">Returns:</span></dt><dd>This implementation always returns true.</dd><dt><span class="strong">Since:</span></dt>
  856. <dd>1.1</dd></dl>
  857. </li>
  858. </ul>
  859. <a name="write(byte[], int, int)">
  860. <!-- -->
  861. </a>
  862. <ul class="blockList">
  863. <li class="blockList">
  864. <h4>write</h4>
  865. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.914">write</a>(byte[]&nbsp;b,
  866. int&nbsp;offset,
  867. int&nbsp;length)
  868. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  869. <div class="block">Writes bytes to ZIP entry.</div>
  870. <dl>
  871. <dt><strong>Overrides:</strong></dt>
  872. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#write(byte[],%20int,%20int)" title="class or interface in java.io">write</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  873. <dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - the byte array to write</dd><dd><code>offset</code> - the start position to write from</dd><dd><code>length</code> - the number of bytes to write</dd>
  874. <dt><span class="strong">Throws:</span></dt>
  875. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  876. </li>
  877. </ul>
  878. <a name="close()">
  879. <!-- -->
  880. </a>
  881. <ul class="blockList">
  882. <li class="blockList">
  883. <h4>close</h4>
  884. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.956">close</a>()
  885. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  886. <div class="block">Closes this output stream and releases any system resources
  887. associated with the stream.</div>
  888. <dl>
  889. <dt><strong>Specified by:</strong></dt>
  890. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
  891. <dt><strong>Specified by:</strong></dt>
  892. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true#close()" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
  893. <dt><strong>Overrides:</strong></dt>
  894. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#close()" title="class or interface in java.io">close</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  895. <dt><span class="strong">Throws:</span></dt>
  896. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs.</dd>
  897. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip">Zip64RequiredException</a></code> - if the archive's size exceeds 4
  898. GByte or there are more than 65535 entries inside the archive
  899. and <a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)"><code>setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode)</code></a> is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Zip64Mode.Never</code></a>.</dd></dl>
  900. </li>
  901. </ul>
  902. <a name="flush()">
  903. <!-- -->
  904. </a>
  905. <ul class="blockList">
  906. <li class="blockList">
  907. <h4>flush</h4>
  908. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.970">flush</a>()
  909. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  910. <div class="block">Flushes this output stream and forces any buffered output bytes
  911. to be written out to the stream.</div>
  912. <dl>
  913. <dt><strong>Specified by:</strong></dt>
  914. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true#flush()" title="class or interface in java.io">flush</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a></code></dd>
  915. <dt><strong>Overrides:</strong></dt>
  916. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#flush()" title="class or interface in java.io">flush</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  917. <dt><span class="strong">Throws:</span></dt>
  918. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs.</dd></dl>
  919. </li>
  920. </ul>
  921. <a name="deflate()">
  922. <!-- -->
  923. </a>
  924. <ul class="blockList">
  925. <li class="blockList">
  926. <h4>deflate</h4>
  927. <pre>protected final&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1008">deflate</a>()
  928. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  929. <div class="block">Writes next block of compressed data to the output stream.</div>
  930. <dl><dt><span class="strong">Throws:</span></dt>
  931. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  932. </li>
  933. </ul>
  934. <a name="writeLocalFileHeader(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)">
  935. <!-- -->
  936. </a>
  937. <ul class="blockList">
  938. <li class="blockList">
  939. <h4>writeLocalFileHeader</h4>
  940. <pre>protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1017">writeLocalFileHeader</a>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;ze)
  941. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  942. <div class="block">Writes the local file header entry</div>
  943. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>ze</code> - the entry to write</dd>
  944. <dt><span class="strong">Throws:</span></dt>
  945. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  946. </li>
  947. </ul>
  948. <a name="writeDataDescriptor(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)">
  949. <!-- -->
  950. </a>
  951. <ul class="blockList">
  952. <li class="blockList">
  953. <h4>writeDataDescriptor</h4>
  954. <pre>protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1145">writeDataDescriptor</a>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;ze)
  955. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  956. <div class="block">Writes the data descriptor entry.</div>
  957. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>ze</code> - the entry to write</dd>
  958. <dt><span class="strong">Throws:</span></dt>
  959. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  960. </li>
  961. </ul>
  962. <a name="writeCentralFileHeader(org.apache.commons.compress.archivers.zip.ZipArchiveEntry)">
  963. <!-- -->
  964. </a>
  965. <ul class="blockList">
  966. <li class="blockList">
  967. <h4>writeCentralFileHeader</h4>
  968. <pre>protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1168">writeCentralFileHeader</a>(<a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveEntry</a>&nbsp;ze)
  969. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  970. <div class="block">Writes the central file header entry.</div>
  971. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>ze</code> - the entry to write</dd>
  972. <dt><span class="strong">Throws:</span></dt>
  973. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd>
  974. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip">Zip64RequiredException</a></code> - if the archive's size exceeds 4
  975. GByte and <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html" title="enum in org.apache.commons.compress.archivers.zip"><code>#setUseZip64</code></a> is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Zip64Mode.Never</code></a>.</dd></dl>
  976. </li>
  977. </ul>
  978. <a name="writeCentralDirectoryEnd()">
  979. <!-- -->
  980. </a>
  981. <ul class="blockList">
  982. <li class="blockList">
  983. <h4>writeCentralDirectoryEnd</h4>
  984. <pre>protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1320">writeCentralDirectoryEnd</a>()
  985. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  986. <div class="block">Writes the &quot;End of central dir record&quot;.</div>
  987. <dl><dt><span class="strong">Throws:</span></dt>
  988. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd>
  989. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64RequiredException.html" title="class in org.apache.commons.compress.archivers.zip">Zip64RequiredException</a></code> - if the archive's size exceeds 4
  990. GByte or there are more than 65535 entries inside the archive
  991. and <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html" title="enum in org.apache.commons.compress.archivers.zip"><code>#setUseZip64</code></a> is <a href="../../../../../../org/apache/commons/compress/archivers/zip/Zip64Mode.html#Never"><code>Zip64Mode.Never</code></a>.</dd></dl>
  992. </li>
  993. </ul>
  994. <a name="writeZip64CentralDirectory()">
  995. <!-- -->
  996. </a>
  997. <ul class="blockList">
  998. <li class="blockList">
  999. <h4>writeZip64CentralDirectory</h4>
  1000. <pre>protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1361">writeZip64CentralDirectory</a>()
  1001. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  1002. <div class="block">Writes the &quot;ZIP64 End of central dir record&quot; and
  1003. &quot;ZIP64 End of central dir locator&quot;.</div>
  1004. <dl><dt><span class="strong">Throws:</span></dt>
  1005. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd><dt><span class="strong">Since:</span></dt>
  1006. <dd>1.3</dd></dl>
  1007. </li>
  1008. </ul>
  1009. <a name="writeOut(byte[])">
  1010. <!-- -->
  1011. </a>
  1012. <ul class="blockList">
  1013. <li class="blockList">
  1014. <h4>writeOut</h4>
  1015. <pre>protected final&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1428">writeOut</a>(byte[]&nbsp;data)
  1016. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  1017. <div class="block">Write bytes to output or random access file.</div>
  1018. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - the byte array to write</dd>
  1019. <dt><span class="strong">Throws:</span></dt>
  1020. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  1021. </li>
  1022. </ul>
  1023. <a name="writeOut(byte[], int, int)">
  1024. <!-- -->
  1025. </a>
  1026. <ul class="blockList">
  1027. <li class="blockList">
  1028. <h4>writeOut</h4>
  1029. <pre>protected final&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1440">writeOut</a>(byte[]&nbsp;data,
  1030. int&nbsp;offset,
  1031. int&nbsp;length)
  1032. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  1033. <div class="block">Write bytes to output or random access file.</div>
  1034. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - the byte array to write</dd><dd><code>offset</code> - the start position to write from</dd><dd><code>length</code> - the number of bytes to write</dd>
  1035. <dt><span class="strong">Throws:</span></dt>
  1036. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  1037. </li>
  1038. </ul>
  1039. <a name="createArchiveEntry(java.io.File, java.lang.String)">
  1040. <!-- -->
  1041. </a>
  1042. <ul class="blockListLast">
  1043. <li class="blockList">
  1044. <h4>createArchiveEntry</h4>
  1045. <pre>public&nbsp;<a href="../../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html#line.1483">createArchiveEntry</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;inputFile,
  1046. <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;entryName)
  1047. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  1048. <div class="block">Creates a new zip entry taking some information from the given
  1049. file and using the provided name.
  1050. <p>The name will be adjusted to end with a forward slash "/" if
  1051. the file is a directory. If the file is not a directory a
  1052. potential trailing forward slash will be stripped from the
  1053. entry name.</p>
  1054. <p>Must not be used if the stream has already been closed.</p></div>
  1055. <dl>
  1056. <dt><strong>Specified by:</strong></dt>
  1057. <dd><code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#createArchiveEntry(java.io.File,%20java.lang.String)">createArchiveEntry</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers">ArchiveOutputStream</a></code></dd>
  1058. <dt><span class="strong">Parameters:</span></dt><dd><code>inputFile</code> - the file to create the entry from</dd><dd><code>entryName</code> - name to use for the entry</dd>
  1059. <dt><span class="strong">Returns:</span></dt><dd>the ArchiveEntry set up with details from the file</dd>
  1060. <dt><span class="strong">Throws:</span></dt>
  1061. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
  1062. </li>
  1063. </ul>
  1064. </li>
  1065. </ul>
  1066. </li>
  1067. </ul>
  1068. </div>
  1069. </div>
  1070. <!-- ========= END OF CLASS DATA ========= -->
  1071. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  1072. <div class="bottomNav"><a name="navbar_bottom">
  1073. <!-- -->
  1074. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  1075. <!-- -->
  1076. </a>
  1077. <ul class="navList" title="Navigation">
  1078. <li><a href="../../../../../../overview-summary.html">Overview</a></li>
  1079. <li><a href="package-summary.html">Package</a></li>
  1080. <li class="navBarCell1Rev">Class</li>
  1081. <li><a href="class-use/ZipArchiveOutputStream.html">Use</a></li>
  1082. <li><a href="package-tree.html">Tree</a></li>
  1083. <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
  1084. <li><a href="../../../../../../index-all.html">Index</a></li>
  1085. <li><a href="../../../../../../help-doc.html">Help</a></li>
  1086. </ul>
  1087. </div>
  1088. <div class="subNav">
  1089. <ul class="navList">
  1090. <li><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.html" title="class in org.apache.commons.compress.archivers.zip"><span class="strong">Prev Class</span></a></li>
  1091. <li><a href="../../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.UnicodeExtraFieldPolicy.html" title="class in org.apache.commons.compress.archivers.zip"><span class="strong">Next Class</span></a></li>
  1092. </ul>
  1093. <ul class="navList">
  1094. <li><a href="../../../../../../index.html?org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html" target="_top">Frames</a></li>
  1095. <li><a href="ZipArchiveOutputStream.html" target="_top">No Frames</a></li>
  1096. </ul>
  1097. <ul class="navList" id="allclasses_navbar_bottom">
  1098. <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
  1099. </ul>
  1100. <div>
  1101. <script type="text/javascript"><!--
  1102. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  1103. if(window==top) {
  1104. allClassesLink.style.display = "block";
  1105. }
  1106. else {
  1107. allClassesLink.style.display = "none";
  1108. }
  1109. //-->
  1110. </script>
  1111. </div>
  1112. <div>
  1113. <ul class="subNavList">
  1114. <li>Summary:&nbsp;</li>
  1115. <li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
  1116. <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
  1117. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  1118. <li><a href="#method_summary">Method</a></li>
  1119. </ul>
  1120. <ul class="subNavList">
  1121. <li>Detail:&nbsp;</li>
  1122. <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
  1123. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  1124. <li><a href="#method_detail">Method</a></li>
  1125. </ul>
  1126. </div>
  1127. <a name="skip-navbar_bottom">
  1128. <!-- -->
  1129. </a></div>
  1130. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  1131. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  1132. </body>
  1133. </html>