ArchiveOutputStream.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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>ArchiveOutputStream (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="ArchiveOutputStream (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/ArchiveOutputStream.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/ArchiveInputStream.html" title="class in org.apache.commons.compress.archivers"><span class="strong">Prev Class</span></a></li>
  43. <li><a href="../../../../../org/apache/commons/compress/archivers/ArchiveStreamFactory.html" title="class in org.apache.commons.compress.archivers"><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/ArchiveOutputStream.html" target="_top">Frames</a></li>
  47. <li><a href="ArchiveOutputStream.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>Nested&nbsp;|&nbsp;</li>
  68. <li>Field&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>Field&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</div>
  86. <h2 title="Class ArchiveOutputStream" class="title">Class ArchiveOutputStream</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>org.apache.commons.compress.archivers.ArchiveOutputStream</li>
  97. </ul>
  98. </li>
  99. </ul>
  100. </li>
  101. </ul>
  102. <div class="description">
  103. <ul class="blockList">
  104. <li class="blockList">
  105. <dl>
  106. <dt>All Implemented Interfaces:</dt>
  107. <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>
  108. </dl>
  109. <dl>
  110. <dt>Direct Known Subclasses:</dt>
  111. <dd><a href="../../../../../org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers.ar">ArArchiveOutputStream</a>, <a href="../../../../../org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers.cpio">CpioArchiveOutputStream</a>, <a href="../../../../../org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers.tar">TarArchiveOutputStream</a>, <a href="../../../../../org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.html" title="class in org.apache.commons.compress.archivers.zip">ZipArchiveOutputStream</a></dd>
  112. </dl>
  113. <hr>
  114. <br>
  115. <pre>public abstract class <a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.47">ArchiveOutputStream</a>
  116. extends <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></pre>
  117. <div class="block">Archive output stream implementations are expected to override the
  118. <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"><code>OutputStream.write(byte[], int, int)</code></a> method to improve performance.
  119. They should also override <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"><code>OutputStream.close()</code></a> to ensure that any necessary
  120. trailers are added.
  121. <p>The normal sequence of calls when working with ArchiveOutputStreams is:</p>
  122. <ul>
  123. <li>Create ArchiveOutputStream object,</li>
  124. <li>optionally write SFX header (Zip only),</li>
  125. <li>repeat as needed:
  126. <ul>
  127. <li><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)"><code>putArchiveEntry(ArchiveEntry)</code></a> (writes entry header),
  128. <li><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"><code>OutputStream.write(byte[])</code></a> (writes entry data, as often as needed),
  129. <li><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#closeArchiveEntry()"><code>closeArchiveEntry()</code></a> (closes entry),
  130. </ul>
  131. </li>
  132. <li> <a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#finish()"><code>finish()</code></a> (ends the addition of entries),</li>
  133. <li> optionally write additional data, provided format supports it,</li>
  134. <li><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"><code>OutputStream.close()</code></a>.</li>
  135. </ul></div>
  136. </li>
  137. </ul>
  138. </div>
  139. <div class="summary">
  140. <ul class="blockList">
  141. <li class="blockList">
  142. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  143. <ul class="blockList">
  144. <li class="blockList"><a name="constructor_summary">
  145. <!-- -->
  146. </a>
  147. <h3>Constructor Summary</h3>
  148. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  149. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  150. <tr>
  151. <th class="colOne" scope="col">Constructor and Description</th>
  152. </tr>
  153. <tr class="altColor">
  154. <td class="colOne"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#ArchiveOutputStream()">ArchiveOutputStream</a></strong>()</code>&nbsp;</td>
  155. </tr>
  156. </table>
  157. </li>
  158. </ul>
  159. <!-- ========== METHOD SUMMARY =========== -->
  160. <ul class="blockList">
  161. <li class="blockList"><a name="method_summary">
  162. <!-- -->
  163. </a>
  164. <h3>Method Summary</h3>
  165. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  166. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  167. <tr>
  168. <th class="colFirst" scope="col">Modifier and Type</th>
  169. <th class="colLast" scope="col">Method and Description</th>
  170. </tr>
  171. <tr class="altColor">
  172. <td class="colFirst"><code>boolean</code></td>
  173. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.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;archiveEntry)</code>
  174. <div class="block">Whether this stream is able to write the given entry.</div>
  175. </td>
  176. </tr>
  177. <tr class="rowColor">
  178. <td class="colFirst"><code>abstract void</code></td>
  179. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#closeArchiveEntry()">closeArchiveEntry</a></strong>()</code>
  180. <div class="block">Closes the archive entry, writing any trailer information that may
  181. be required.</div>
  182. </td>
  183. </tr>
  184. <tr class="altColor">
  185. <td class="colFirst"><code>protected void</code></td>
  186. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#count(int)">count</a></strong>(int&nbsp;written)</code>
  187. <div class="block">Increments the counter of already written bytes.</div>
  188. </td>
  189. </tr>
  190. <tr class="rowColor">
  191. <td class="colFirst"><code>protected void</code></td>
  192. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#count(long)">count</a></strong>(long&nbsp;written)</code>
  193. <div class="block">Increments the counter of already written bytes.</div>
  194. </td>
  195. </tr>
  196. <tr class="altColor">
  197. <td class="colFirst"><code>abstract <a href="../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a></code></td>
  198. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.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,
  199. <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>
  200. <div class="block">Create an archive entry using the inputFile and entryName provided.</div>
  201. </td>
  202. </tr>
  203. <tr class="rowColor">
  204. <td class="colFirst"><code>abstract void</code></td>
  205. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#finish()">finish</a></strong>()</code>
  206. <div class="block">Finishes the addition of entries to this stream, without closing it.</div>
  207. </td>
  208. </tr>
  209. <tr class="altColor">
  210. <td class="colFirst"><code>long</code></td>
  211. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#getBytesWritten()">getBytesWritten</a></strong>()</code>
  212. <div class="block">Returns the current number of bytes written to this stream.</div>
  213. </td>
  214. </tr>
  215. <tr class="rowColor">
  216. <td class="colFirst"><code>int</code></td>
  217. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#getCount()">getCount</a></strong>()</code>
  218. <div class="block"><strong>Deprecated.</strong>&nbsp;
  219. <div class="block"><i>this method may yield wrong results for large
  220. archives, use #getBytesWritten instead</i></div>
  221. </div>
  222. </td>
  223. </tr>
  224. <tr class="altColor">
  225. <td class="colFirst"><code>abstract void</code></td>
  226. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.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;entry)</code>
  227. <div class="block">Writes the headers for an archive entry to the output stream.</div>
  228. </td>
  229. </tr>
  230. <tr class="rowColor">
  231. <td class="colFirst"><code>void</code></td>
  232. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#write(int)">write</a></strong>(int&nbsp;b)</code>
  233. <div class="block">Writes a byte to the current archive entry.</div>
  234. </td>
  235. </tr>
  236. </table>
  237. <ul class="blockList">
  238. <li class="blockList"><a name="methods_inherited_from_class_java.io.OutputStream">
  239. <!-- -->
  240. </a>
  241. <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>
  242. <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>, <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>, <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>, <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></li>
  243. </ul>
  244. <ul class="blockList">
  245. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  246. <!-- -->
  247. </a>
  248. <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>
  249. <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>
  250. </ul>
  251. </li>
  252. </ul>
  253. </li>
  254. </ul>
  255. </div>
  256. <div class="details">
  257. <ul class="blockList">
  258. <li class="blockList">
  259. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  260. <ul class="blockList">
  261. <li class="blockList"><a name="constructor_detail">
  262. <!-- -->
  263. </a>
  264. <h3>Constructor Detail</h3>
  265. <a name="ArchiveOutputStream()">
  266. <!-- -->
  267. </a>
  268. <ul class="blockListLast">
  269. <li class="blockList">
  270. <h4>ArchiveOutputStream</h4>
  271. <pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.47">ArchiveOutputStream</a>()</pre>
  272. </li>
  273. </ul>
  274. </li>
  275. </ul>
  276. <!-- ============ METHOD DETAIL ========== -->
  277. <ul class="blockList">
  278. <li class="blockList"><a name="method_detail">
  279. <!-- -->
  280. </a>
  281. <h3>Method Detail</h3>
  282. <a name="putArchiveEntry(org.apache.commons.compress.archivers.ArchiveEntry)">
  283. <!-- -->
  284. </a>
  285. <ul class="blockList">
  286. <li class="blockList">
  287. <h4>putArchiveEntry</h4>
  288. <pre>public abstract&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.65">putArchiveEntry</a>(<a href="../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;entry)
  289. 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>
  290. <div class="block">Writes the headers for an archive entry to the output stream.
  291. The caller must then write the content to the stream and call
  292. <a href="../../../../../org/apache/commons/compress/archivers/ArchiveOutputStream.html#closeArchiveEntry()"><code>closeArchiveEntry()</code></a> to complete the process.</div>
  293. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>entry</code> - describes the entry</dd>
  294. <dt><span class="strong">Throws:</span></dt>
  295. <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>
  296. </li>
  297. </ul>
  298. <a name="closeArchiveEntry()">
  299. <!-- -->
  300. </a>
  301. <ul class="blockList">
  302. <li class="blockList">
  303. <h4>closeArchiveEntry</h4>
  304. <pre>public abstract&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.72">closeArchiveEntry</a>()
  305. 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>
  306. <div class="block">Closes the archive entry, writing any trailer information that may
  307. be required.</div>
  308. <dl><dt><span class="strong">Throws:</span></dt>
  309. <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>
  310. </li>
  311. </ul>
  312. <a name="finish()">
  313. <!-- -->
  314. </a>
  315. <ul class="blockList">
  316. <li class="blockList">
  317. <h4>finish</h4>
  318. <pre>public abstract&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.80">finish</a>()
  319. 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>
  320. <div class="block">Finishes the addition of entries to this stream, without closing it.
  321. Additional data can be written, if the format supports it.</div>
  322. <dl><dt><span class="strong">Throws:</span></dt>
  323. <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>
  324. </li>
  325. </ul>
  326. <a name="createArchiveEntry(java.io.File, java.lang.String)">
  327. <!-- -->
  328. </a>
  329. <ul class="blockList">
  330. <li class="blockList">
  331. <h4>createArchiveEntry</h4>
  332. <pre>public abstract&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/ArchiveOutputStream.html#line.91">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,
  333. <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)
  334. 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>
  335. <div class="block">Create an archive entry using the inputFile and entryName provided.</div>
  336. <dl><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>
  337. <dt><span class="strong">Returns:</span></dt><dd>the ArchiveEntry set up with details from the file</dd>
  338. <dt><span class="strong">Throws:</span></dt>
  339. <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>
  340. </li>
  341. </ul>
  342. <a name="write(int)">
  343. <!-- -->
  344. </a>
  345. <ul class="blockList">
  346. <li class="blockList">
  347. <h4>write</h4>
  348. <pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.107">write</a>(int&nbsp;b)
  349. 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>
  350. <div class="block">Writes a byte to the current archive entry.
  351. <p>This method simply calls <code>write( byte[], 0, 1 )</code>.
  352. <p>MUST be overridden if the <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"><code>OutputStream.write(byte[], int, int)</code></a> method
  353. is not overridden; may be overridden otherwise.</div>
  354. <dl>
  355. <dt><strong>Specified by:</strong></dt>
  356. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#write(int)" 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>
  357. <dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - The byte to be written.</dd>
  358. <dt><span class="strong">Throws:</span></dt>
  359. <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>
  360. </li>
  361. </ul>
  362. <a name="count(int)">
  363. <!-- -->
  364. </a>
  365. <ul class="blockList">
  366. <li class="blockList">
  367. <h4>count</h4>
  368. <pre>protected&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.118">count</a>(int&nbsp;written)</pre>
  369. <div class="block">Increments the counter of already written bytes.
  370. Doesn't increment if EOF has been hit (<code>written == -1</code>).</div>
  371. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>written</code> - the number of bytes written</dd></dl>
  372. </li>
  373. </ul>
  374. <a name="count(long)">
  375. <!-- -->
  376. </a>
  377. <ul class="blockList">
  378. <li class="blockList">
  379. <h4>count</h4>
  380. <pre>protected&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.129">count</a>(long&nbsp;written)</pre>
  381. <div class="block">Increments the counter of already written bytes.
  382. Doesn't increment if EOF has been hit (<code>written == -1</code>).</div>
  383. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>written</code> - the number of bytes written</dd><dt><span class="strong">Since:</span></dt>
  384. <dd>1.1</dd></dl>
  385. </li>
  386. </ul>
  387. <a name="getCount()">
  388. <!-- -->
  389. </a>
  390. <ul class="blockList">
  391. <li class="blockList">
  392. <h4>getCount</h4>
  393. <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>
  394. public&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.142">getCount</a>()</pre>
  395. <div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>this method may yield wrong results for large
  396. archives, use #getBytesWritten instead</i></div>
  397. <div class="block">Returns the current number of bytes written to this stream.</div>
  398. <dl><dt><span class="strong">Returns:</span></dt><dd>the number of written bytes</dd></dl>
  399. </li>
  400. </ul>
  401. <a name="getBytesWritten()">
  402. <!-- -->
  403. </a>
  404. <ul class="blockList">
  405. <li class="blockList">
  406. <h4>getBytesWritten</h4>
  407. <pre>public&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.151">getBytesWritten</a>()</pre>
  408. <div class="block">Returns the current number of bytes written to this stream.</div>
  409. <dl><dt><span class="strong">Returns:</span></dt><dd>the number of written bytes</dd><dt><span class="strong">Since:</span></dt>
  410. <dd>1.1</dd></dl>
  411. </li>
  412. </ul>
  413. <a name="canWriteEntryData(org.apache.commons.compress.archivers.ArchiveEntry)">
  414. <!-- -->
  415. </a>
  416. <ul class="blockListLast">
  417. <li class="blockList">
  418. <h4>canWriteEntryData</h4>
  419. <pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/archivers/ArchiveOutputStream.html#line.166">canWriteEntryData</a>(<a href="../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;archiveEntry)</pre>
  420. <div class="block">Whether this stream is able to write the given entry.
  421. <p>Some archive formats support variants or details that are
  422. not supported (yet).</p></div>
  423. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>archiveEntry</code> - the entry to test</dd>
  424. <dt><span class="strong">Returns:</span></dt><dd>This implementation always returns true.</dd><dt><span class="strong">Since:</span></dt>
  425. <dd>1.1</dd></dl>
  426. </li>
  427. </ul>
  428. </li>
  429. </ul>
  430. </li>
  431. </ul>
  432. </div>
  433. </div>
  434. <!-- ========= END OF CLASS DATA ========= -->
  435. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  436. <div class="bottomNav"><a name="navbar_bottom">
  437. <!-- -->
  438. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  439. <!-- -->
  440. </a>
  441. <ul class="navList" title="Navigation">
  442. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  443. <li><a href="package-summary.html">Package</a></li>
  444. <li class="navBarCell1Rev">Class</li>
  445. <li><a href="class-use/ArchiveOutputStream.html">Use</a></li>
  446. <li><a href="package-tree.html">Tree</a></li>
  447. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  448. <li><a href="../../../../../index-all.html">Index</a></li>
  449. <li><a href="../../../../../help-doc.html">Help</a></li>
  450. </ul>
  451. </div>
  452. <div class="subNav">
  453. <ul class="navList">
  454. <li><a href="../../../../../org/apache/commons/compress/archivers/ArchiveInputStream.html" title="class in org.apache.commons.compress.archivers"><span class="strong">Prev Class</span></a></li>
  455. <li><a href="../../../../../org/apache/commons/compress/archivers/ArchiveStreamFactory.html" title="class in org.apache.commons.compress.archivers"><span class="strong">Next Class</span></a></li>
  456. </ul>
  457. <ul class="navList">
  458. <li><a href="../../../../../index.html?org/apache/commons/compress/archivers/ArchiveOutputStream.html" target="_top">Frames</a></li>
  459. <li><a href="ArchiveOutputStream.html" target="_top">No Frames</a></li>
  460. </ul>
  461. <ul class="navList" id="allclasses_navbar_bottom">
  462. <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
  463. </ul>
  464. <div>
  465. <script type="text/javascript"><!--
  466. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  467. if(window==top) {
  468. allClassesLink.style.display = "block";
  469. }
  470. else {
  471. allClassesLink.style.display = "none";
  472. }
  473. //-->
  474. </script>
  475. </div>
  476. <div>
  477. <ul class="subNavList">
  478. <li>Summary:&nbsp;</li>
  479. <li>Nested&nbsp;|&nbsp;</li>
  480. <li>Field&nbsp;|&nbsp;</li>
  481. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  482. <li><a href="#method_summary">Method</a></li>
  483. </ul>
  484. <ul class="subNavList">
  485. <li>Detail:&nbsp;</li>
  486. <li>Field&nbsp;|&nbsp;</li>
  487. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  488. <li><a href="#method_detail">Method</a></li>
  489. </ul>
  490. </div>
  491. <a name="skip-navbar_bottom">
  492. <!-- -->
  493. </a></div>
  494. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  495. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  496. </body>
  497. </html>