SevenZFile.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  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>SevenZFile (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="SevenZFile (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/SevenZFile.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/sevenz/SevenZArchiveEntry.html" title="class in org.apache.commons.compress.archivers.sevenz"><span class="strong">Prev Class</span></a></li>
  43. <li><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZMethod.html" title="enum in org.apache.commons.compress.archivers.sevenz"><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/sevenz/SevenZFile.html" target="_top">Frames</a></li>
  47. <li><a href="SevenZFile.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.sevenz</div>
  86. <h2 title="Class SevenZFile" class="title">Class SevenZFile</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>org.apache.commons.compress.archivers.sevenz.SevenZFile</li>
  94. </ul>
  95. </li>
  96. </ul>
  97. <div class="description">
  98. <ul class="blockList">
  99. <li class="blockList">
  100. <dl>
  101. <dt>All Implemented Interfaces:</dt>
  102. <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/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></dd>
  103. </dl>
  104. <hr>
  105. <br>
  106. <pre>public class <a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.73">SevenZFile</a>
  107. extends <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>
  108. implements <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></pre>
  109. <div class="block">Reads a 7z file, using SeekableByteChannel under
  110. the covers.
  111. <p>
  112. The 7z file format is a flexible container
  113. that can contain many compression and
  114. encryption types, but at the moment only
  115. only Copy, LZMA, LZMA2, BZIP2, Deflate and AES-256 + SHA-256
  116. are supported.
  117. <p>
  118. The format is very Windows/Intel specific,
  119. so it uses little-endian byte order,
  120. doesn't store user/group or permission bits,
  121. and represents times using NTFS timestamps
  122. (100 nanosecond units since 1 January 1601).
  123. Hence the official tools recommend against
  124. using it for backup purposes on *nix, and
  125. recommend .tar.7z or .tar.lzma or .tar.xz
  126. instead.
  127. <p>
  128. Both the header and file contents may be
  129. compressed and/or encrypted. With both
  130. encrypted, neither file names nor file
  131. contents can be read, but the use of
  132. encryption isn't plausibly deniable.</div>
  133. <dl><dt><span class="strong">Since:</span></dt>
  134. <dd>1.6</dd>
  135. <dt><span class="strong">This class is not thread-safe</span></dt>
  136. <dd></dd></dl>
  137. </li>
  138. </ul>
  139. </div>
  140. <div class="summary">
  141. <ul class="blockList">
  142. <li class="blockList">
  143. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  144. <ul class="blockList">
  145. <li class="blockList"><a name="constructor_summary">
  146. <!-- -->
  147. </a>
  148. <h3>Constructor Summary</h3>
  149. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  150. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  151. <tr>
  152. <th class="colOne" scope="col">Constructor and Description</th>
  153. </tr>
  154. <tr class="altColor">
  155. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#SevenZFile(java.io.File)">SevenZFile</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;filename)</code>
  156. <div class="block">Reads a file as unencrypted 7z archive</div>
  157. </td>
  158. </tr>
  159. <tr class="rowColor">
  160. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#SevenZFile(java.io.File,%20byte[])">SevenZFile</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;filename,
  161. byte[]&nbsp;password)</code>
  162. <div class="block">Reads a file as 7z archive</div>
  163. </td>
  164. </tr>
  165. <tr class="altColor">
  166. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#SevenZFile(java.nio.channels.SeekableByteChannel)">SevenZFile</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>
  167. <div class="block">Reads a SeekableByteChannel as 7z archive
  168. <a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  169. allows you to read from an in-memory archive.</div>
  170. </td>
  171. </tr>
  172. <tr class="rowColor">
  173. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#SevenZFile(java.nio.channels.SeekableByteChannel,%20byte[])">SevenZFile</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,
  174. byte[]&nbsp;password)</code>
  175. <div class="block">Reads a SeekableByteChannel as 7z archive
  176. <a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  177. allows you to read from an in-memory archive.</div>
  178. </td>
  179. </tr>
  180. <tr class="altColor">
  181. <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#SevenZFile(java.nio.channels.SeekableByteChannel,%20java.lang.String,%20byte[])">SevenZFile</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,
  182. <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;filename,
  183. byte[]&nbsp;password)</code>
  184. <div class="block">Reads a SeekableByteChannel as 7z archive
  185. <a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  186. allows you to read from an in-memory archive.</div>
  187. </td>
  188. </tr>
  189. </table>
  190. </li>
  191. </ul>
  192. <!-- ========== METHOD SUMMARY =========== -->
  193. <ul class="blockList">
  194. <li class="blockList"><a name="method_summary">
  195. <!-- -->
  196. </a>
  197. <h3>Method Summary</h3>
  198. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  199. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  200. <tr>
  201. <th class="colFirst" scope="col">Modifier and Type</th>
  202. <th class="colLast" scope="col">Method and Description</th>
  203. </tr>
  204. <tr class="altColor">
  205. <td class="colFirst"><code>void</code></td>
  206. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#close()">close</a></strong>()</code>
  207. <div class="block">Closes the archive.</div>
  208. </td>
  209. </tr>
  210. <tr class="rowColor">
  211. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.html" title="class in org.apache.commons.compress.archivers.sevenz">SevenZArchiveEntry</a>&gt;</code></td>
  212. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#getEntries()">getEntries</a></strong>()</code>
  213. <div class="block">Returns meta-data of all archive entries.</div>
  214. </td>
  215. </tr>
  216. <tr class="altColor">
  217. <td class="colFirst"><code><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.html" title="class in org.apache.commons.compress.archivers.sevenz">SevenZArchiveEntry</a></code></td>
  218. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#getNextEntry()">getNextEntry</a></strong>()</code>
  219. <div class="block">Returns the next Archive Entry in this archive.</div>
  220. </td>
  221. </tr>
  222. <tr class="rowColor">
  223. <td class="colFirst"><code>static boolean</code></td>
  224. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#matches(byte[],%20int)">matches</a></strong>(byte[]&nbsp;signature,
  225. int&nbsp;length)</code>
  226. <div class="block">Checks if the signature matches what is expected for a 7z file.</div>
  227. </td>
  228. </tr>
  229. <tr class="altColor">
  230. <td class="colFirst"><code>int</code></td>
  231. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#read()">read</a></strong>()</code>
  232. <div class="block">Reads a byte of data.</div>
  233. </td>
  234. </tr>
  235. <tr class="rowColor">
  236. <td class="colFirst"><code>int</code></td>
  237. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#read(byte[])">read</a></strong>(byte[]&nbsp;b)</code>
  238. <div class="block">Reads data into an array of bytes.</div>
  239. </td>
  240. </tr>
  241. <tr class="altColor">
  242. <td class="colFirst"><code>int</code></td>
  243. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#read(byte[],%20int,%20int)">read</a></strong>(byte[]&nbsp;b,
  244. int&nbsp;off,
  245. int&nbsp;len)</code>
  246. <div class="block">Reads data into an array of bytes.</div>
  247. </td>
  248. </tr>
  249. <tr class="rowColor">
  250. <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>
  251. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#toString()">toString</a></strong>()</code>&nbsp;</td>
  252. </tr>
  253. </table>
  254. <ul class="blockList">
  255. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  256. <!-- -->
  257. </a>
  258. <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>
  259. <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#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>
  260. </ul>
  261. </li>
  262. </ul>
  263. </li>
  264. </ul>
  265. </div>
  266. <div class="details">
  267. <ul class="blockList">
  268. <li class="blockList">
  269. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  270. <ul class="blockList">
  271. <li class="blockList"><a name="constructor_detail">
  272. <!-- -->
  273. </a>
  274. <h3>Constructor Detail</h3>
  275. <a name="SevenZFile(java.io.File, byte[])">
  276. <!-- -->
  277. </a>
  278. <ul class="blockList">
  279. <li class="blockList">
  280. <h4>SevenZFile</h4>
  281. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.100">SevenZFile</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;filename,
  282. byte[]&nbsp;password)
  283. 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>
  284. <div class="block">Reads a file as 7z archive</div>
  285. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - the file to read</dd><dd><code>password</code> - optional password if the archive is encrypted -
  286. the byte array is supposed to be the UTF16-LE encoded
  287. representation of the password.</dd>
  288. <dt><span class="strong">Throws:</span></dt>
  289. <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 reading the archive fails</dd></dl>
  290. </li>
  291. </ul>
  292. <a name="SevenZFile(java.nio.channels.SeekableByteChannel)">
  293. <!-- -->
  294. </a>
  295. <ul class="blockList">
  296. <li class="blockList">
  297. <h4>SevenZFile</h4>
  298. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.116">SevenZFile</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)
  299. 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>
  300. <div class="block">Reads a SeekableByteChannel as 7z archive
  301. <p><a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  302. allows you to read from an in-memory archive.</p></div>
  303. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>channel</code> - the channel to read</dd>
  304. <dt><span class="strong">Throws:</span></dt>
  305. <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 reading the archive fails</dd><dt><span class="strong">Since:</span></dt>
  306. <dd>1.13</dd></dl>
  307. </li>
  308. </ul>
  309. <a name="SevenZFile(java.nio.channels.SeekableByteChannel, byte[])">
  310. <!-- -->
  311. </a>
  312. <ul class="blockList">
  313. <li class="blockList">
  314. <h4>SevenZFile</h4>
  315. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.134">SevenZFile</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,
  316. byte[]&nbsp;password)
  317. 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>
  318. <div class="block">Reads a SeekableByteChannel as 7z archive
  319. <p><a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  320. allows you to read from an in-memory archive.</p></div>
  321. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>channel</code> - the channel to read</dd><dd><code>password</code> - optional password if the archive is encrypted -
  322. the byte array is supposed to be the UTF16-LE encoded
  323. representation of the password.</dd>
  324. <dt><span class="strong">Throws:</span></dt>
  325. <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 reading the archive fails</dd><dt><span class="strong">Since:</span></dt>
  326. <dd>1.13</dd></dl>
  327. </li>
  328. </ul>
  329. <a name="SevenZFile(java.nio.channels.SeekableByteChannel, java.lang.String, byte[])">
  330. <!-- -->
  331. </a>
  332. <ul class="blockList">
  333. <li class="blockList">
  334. <h4>SevenZFile</h4>
  335. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.154">SevenZFile</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,
  336. <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;filename,
  337. byte[]&nbsp;password)
  338. 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>
  339. <div class="block">Reads a SeekableByteChannel as 7z archive
  340. <p><a href="../../../../../../org/apache/commons/compress/utils/SeekableInMemoryByteChannel.html" title="class in org.apache.commons.compress.utils"><code>SeekableInMemoryByteChannel</code></a>
  341. allows you to read from an in-memory archive.</p></div>
  342. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>channel</code> - the channel to read</dd><dd><code>filename</code> - name of the archive - only used for error reporting</dd><dd><code>password</code> - optional password if the archive is encrypted -
  343. the byte array is supposed to be the UTF16-LE encoded
  344. representation of the password.</dd>
  345. <dt><span class="strong">Throws:</span></dt>
  346. <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 reading the archive fails</dd><dt><span class="strong">Since:</span></dt>
  347. <dd>1.13</dd></dl>
  348. </li>
  349. </ul>
  350. <a name="SevenZFile(java.io.File)">
  351. <!-- -->
  352. </a>
  353. <ul class="blockListLast">
  354. <li class="blockList">
  355. <h4>SevenZFile</h4>
  356. <pre>public&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.186">SevenZFile</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;filename)
  357. 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>
  358. <div class="block">Reads a file as unencrypted 7z archive</div>
  359. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - the file to read</dd>
  360. <dt><span class="strong">Throws:</span></dt>
  361. <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 reading the archive fails</dd></dl>
  362. </li>
  363. </ul>
  364. </li>
  365. </ul>
  366. <!-- ============ METHOD DETAIL ========== -->
  367. <ul class="blockList">
  368. <li class="blockList"><a name="method_detail">
  369. <!-- -->
  370. </a>
  371. <h3>Method Detail</h3>
  372. <a name="close()">
  373. <!-- -->
  374. </a>
  375. <ul class="blockList">
  376. <li class="blockList">
  377. <h4>close</h4>
  378. <pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.195">close</a>()
  379. 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>
  380. <div class="block">Closes the archive.</div>
  381. <dl>
  382. <dt><strong>Specified by:</strong></dt>
  383. <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>
  384. <dt><strong>Specified by:</strong></dt>
  385. <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>
  386. <dt><span class="strong">Throws:</span></dt>
  387. <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 closing the file fails</dd></dl>
  388. </li>
  389. </ul>
  390. <a name="getNextEntry()">
  391. <!-- -->
  392. </a>
  393. <ul class="blockList">
  394. <li class="blockList">
  395. <h4>getNextEntry</h4>
  396. <pre>public&nbsp;<a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.html" title="class in org.apache.commons.compress.archivers.sevenz">SevenZArchiveEntry</a>&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.216">getNextEntry</a>()
  397. 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>
  398. <div class="block">Returns the next Archive Entry in this archive.</div>
  399. <dl><dt><span class="strong">Returns:</span></dt><dd>the next entry,
  400. or <code>null</code> if there are no more entries</dd>
  401. <dt><span class="strong">Throws:</span></dt>
  402. <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 next entry could not be read</dd></dl>
  403. </li>
  404. </ul>
  405. <a name="getEntries()">
  406. <!-- -->
  407. </a>
  408. <ul class="blockList">
  409. <li class="blockList">
  410. <h4>getEntries</h4>
  411. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.html" title="class in org.apache.commons.compress.archivers.sevenz">SevenZArchiveEntry</a>&gt;&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.239">getEntries</a>()</pre>
  412. <div class="block">Returns meta-data of all archive entries.
  413. <p>This method only provides meta-data, the entries can not be
  414. used to read the contents, you still need to process all
  415. entries in order using <a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#getNextEntry()"><code>getNextEntry()</code></a> for that.</p>
  416. <p>The content methods are only available for entries that have
  417. already been reached via <a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZFile.html#getNextEntry()"><code>getNextEntry()</code></a>.</p></div>
  418. <dl><dt><span class="strong">Returns:</span></dt><dd>meta-data of all archive entries.</dd><dt><span class="strong">Since:</span></dt>
  419. <dd>1.11</dd></dl>
  420. </li>
  421. </ul>
  422. <a name="read()">
  423. <!-- -->
  424. </a>
  425. <ul class="blockList">
  426. <li class="blockList">
  427. <h4>read</h4>
  428. <pre>public&nbsp;int&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.953">read</a>()
  429. 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>
  430. <div class="block">Reads a byte of data.</div>
  431. <dl><dt><span class="strong">Returns:</span></dt><dd>the byte read, or -1 if end of input is reached</dd>
  432. <dt><span class="strong">Throws:</span></dt>
  433. <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 has occurred</dd></dl>
  434. </li>
  435. </ul>
  436. <a name="read(byte[])">
  437. <!-- -->
  438. </a>
  439. <ul class="blockList">
  440. <li class="blockList">
  441. <h4>read</h4>
  442. <pre>public&nbsp;int&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.985">read</a>(byte[]&nbsp;b)
  443. 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>
  444. <div class="block">Reads data into an array of bytes.</div>
  445. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - the array to write data to</dd>
  446. <dt><span class="strong">Returns:</span></dt><dd>the number of bytes read, or -1 if end of input is reached</dd>
  447. <dt><span class="strong">Throws:</span></dt>
  448. <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 has occurred</dd></dl>
  449. </li>
  450. </ul>
  451. <a name="read(byte[], int, int)">
  452. <!-- -->
  453. </a>
  454. <ul class="blockList">
  455. <li class="blockList">
  456. <h4>read</h4>
  457. <pre>public&nbsp;int&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.999">read</a>(byte[]&nbsp;b,
  458. int&nbsp;off,
  459. int&nbsp;len)
  460. 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>
  461. <div class="block">Reads data into an array of bytes.</div>
  462. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - the array to write data to</dd><dd><code>off</code> - offset into the buffer to start filling at</dd><dd><code>len</code> - of bytes to read</dd>
  463. <dt><span class="strong">Returns:</span></dt><dd>the number of bytes read, or -1 if end of input is reached</dd>
  464. <dt><span class="strong">Throws:</span></dt>
  465. <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 has occurred</dd></dl>
  466. </li>
  467. </ul>
  468. <a name="matches(byte[], int)">
  469. <!-- -->
  470. </a>
  471. <ul class="blockList">
  472. <li class="blockList">
  473. <h4>matches</h4>
  474. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/archivers/sevenz/SevenZFile.html#line.1033">matches</a>(byte[]&nbsp;signature,
  475. int&nbsp;length)</pre>
  476. <div class="block">Checks if the signature matches what is expected for a 7z file.</div>
  477. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>signature</code> - the bytes to check</dd><dd><code>length</code> - the number of bytes to check</dd>
  478. <dt><span class="strong">Returns:</span></dt><dd>true, if this is the signature of a 7z archive.</dd><dt><span class="strong">Since:</span></dt>
  479. <dd>1.8</dd></dl>
  480. </li>
  481. </ul>
  482. <a name="toString()">
  483. <!-- -->
  484. </a>
  485. <ul class="blockListLast">
  486. <li class="blockList">
  487. <h4>toString</h4>
  488. <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/sevenz/SevenZFile.html#line.1066">toString</a>()</pre>
  489. <dl>
  490. <dt><strong>Overrides:</strong></dt>
  491. <dd><code><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></code>&nbsp;in class&nbsp;<code><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></code></dd>
  492. </dl>
  493. </li>
  494. </ul>
  495. </li>
  496. </ul>
  497. </li>
  498. </ul>
  499. </div>
  500. </div>
  501. <!-- ========= END OF CLASS DATA ========= -->
  502. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  503. <div class="bottomNav"><a name="navbar_bottom">
  504. <!-- -->
  505. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  506. <!-- -->
  507. </a>
  508. <ul class="navList" title="Navigation">
  509. <li><a href="../../../../../../overview-summary.html">Overview</a></li>
  510. <li><a href="package-summary.html">Package</a></li>
  511. <li class="navBarCell1Rev">Class</li>
  512. <li><a href="class-use/SevenZFile.html">Use</a></li>
  513. <li><a href="package-tree.html">Tree</a></li>
  514. <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
  515. <li><a href="../../../../../../index-all.html">Index</a></li>
  516. <li><a href="../../../../../../help-doc.html">Help</a></li>
  517. </ul>
  518. </div>
  519. <div class="subNav">
  520. <ul class="navList">
  521. <li><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.html" title="class in org.apache.commons.compress.archivers.sevenz"><span class="strong">Prev Class</span></a></li>
  522. <li><a href="../../../../../../org/apache/commons/compress/archivers/sevenz/SevenZMethod.html" title="enum in org.apache.commons.compress.archivers.sevenz"><span class="strong">Next Class</span></a></li>
  523. </ul>
  524. <ul class="navList">
  525. <li><a href="../../../../../../index.html?org/apache/commons/compress/archivers/sevenz/SevenZFile.html" target="_top">Frames</a></li>
  526. <li><a href="SevenZFile.html" target="_top">No Frames</a></li>
  527. </ul>
  528. <ul class="navList" id="allclasses_navbar_bottom">
  529. <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
  530. </ul>
  531. <div>
  532. <script type="text/javascript"><!--
  533. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  534. if(window==top) {
  535. allClassesLink.style.display = "block";
  536. }
  537. else {
  538. allClassesLink.style.display = "none";
  539. }
  540. //-->
  541. </script>
  542. </div>
  543. <div>
  544. <ul class="subNavList">
  545. <li>Summary:&nbsp;</li>
  546. <li>Nested&nbsp;|&nbsp;</li>
  547. <li>Field&nbsp;|&nbsp;</li>
  548. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  549. <li><a href="#method_summary">Method</a></li>
  550. </ul>
  551. <ul class="subNavList">
  552. <li>Detail:&nbsp;</li>
  553. <li>Field&nbsp;|&nbsp;</li>
  554. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  555. <li><a href="#method_detail">Method</a></li>
  556. </ul>
  557. </div>
  558. <a name="skip-navbar_bottom">
  559. <!-- -->
  560. </a></div>
  561. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  562. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  563. </body>
  564. </html>