ArchiveUtils.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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>ArchiveUtils (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="ArchiveUtils (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/ArchiveUtils.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>Prev Class</li>
  43. <li><a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html" title="class in org.apache.commons.compress.utils"><span class="strong">Next Class</span></a></li>
  44. </ul>
  45. <ul class="navList">
  46. <li><a href="../../../../../index.html?org/apache/commons/compress/utils/ArchiveUtils.html" target="_top">Frames</a></li>
  47. <li><a href="ArchiveUtils.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>Constr&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>Constr&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.utils</div>
  86. <h2 title="Class ArchiveUtils" class="title">Class ArchiveUtils</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.utils.ArchiveUtils</li>
  94. </ul>
  95. </li>
  96. </ul>
  97. <div class="description">
  98. <ul class="blockList">
  99. <li class="blockList">
  100. <hr>
  101. <br>
  102. <pre>public class <a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.29">ArchiveUtils</a>
  103. 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></pre>
  104. <div class="block">Generic Archive utilities</div>
  105. </li>
  106. </ul>
  107. </div>
  108. <div class="summary">
  109. <ul class="blockList">
  110. <li class="blockList">
  111. <!-- ========== METHOD SUMMARY =========== -->
  112. <ul class="blockList">
  113. <li class="blockList"><a name="method_summary">
  114. <!-- -->
  115. </a>
  116. <h3>Method Summary</h3>
  117. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  118. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  119. <tr>
  120. <th class="colFirst" scope="col">Modifier and Type</th>
  121. <th class="colLast" scope="col">Method and Description</th>
  122. </tr>
  123. <tr class="altColor">
  124. <td class="colFirst"><code>static boolean</code></td>
  125. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#isArrayZero(byte[],%20int)">isArrayZero</a></strong>(byte[]&nbsp;a,
  126. int&nbsp;size)</code>
  127. <div class="block">Returns true if the first N bytes of an array are all zero</div>
  128. </td>
  129. </tr>
  130. <tr class="rowColor">
  131. <td class="colFirst"><code>static boolean</code></td>
  132. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#isEqual(byte[],%20byte[])">isEqual</a></strong>(byte[]&nbsp;buffer1,
  133. byte[]&nbsp;buffer2)</code>
  134. <div class="block">Compare byte buffers</div>
  135. </td>
  136. </tr>
  137. <tr class="altColor">
  138. <td class="colFirst"><code>static boolean</code></td>
  139. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#isEqual(byte[],%20byte[],%20boolean)">isEqual</a></strong>(byte[]&nbsp;buffer1,
  140. byte[]&nbsp;buffer2,
  141. boolean&nbsp;ignoreTrailingNulls)</code>
  142. <div class="block">Compare byte buffers, optionally ignoring trailing nulls</div>
  143. </td>
  144. </tr>
  145. <tr class="rowColor">
  146. <td class="colFirst"><code>static boolean</code></td>
  147. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#isEqual(byte[],%20int,%20int,%20byte[],%20int,%20int)">isEqual</a></strong>(byte[]&nbsp;buffer1,
  148. int&nbsp;offset1,
  149. int&nbsp;length1,
  150. byte[]&nbsp;buffer2,
  151. int&nbsp;offset2,
  152. int&nbsp;length2)</code>
  153. <div class="block">Compare byte buffers</div>
  154. </td>
  155. </tr>
  156. <tr class="altColor">
  157. <td class="colFirst"><code>static boolean</code></td>
  158. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#isEqual(byte[],%20int,%20int,%20byte[],%20int,%20int,%20boolean)">isEqual</a></strong>(byte[]&nbsp;buffer1,
  159. int&nbsp;offset1,
  160. int&nbsp;length1,
  161. byte[]&nbsp;buffer2,
  162. int&nbsp;offset2,
  163. int&nbsp;length2,
  164. boolean&nbsp;ignoreTrailingNulls)</code>
  165. <div class="block">Compare byte buffers, optionally ignoring trailing nulls</div>
  166. </td>
  167. </tr>
  168. <tr class="rowColor">
  169. <td class="colFirst"><code>static boolean</code></td>
  170. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#isEqualWithNull(byte[],%20int,%20int,%20byte[],%20int,%20int)">isEqualWithNull</a></strong>(byte[]&nbsp;buffer1,
  171. int&nbsp;offset1,
  172. int&nbsp;length1,
  173. byte[]&nbsp;buffer2,
  174. int&nbsp;offset2,
  175. int&nbsp;length2)</code>
  176. <div class="block">Compare byte buffers, ignoring trailing nulls</div>
  177. </td>
  178. </tr>
  179. <tr class="altColor">
  180. <td class="colFirst"><code>static boolean</code></td>
  181. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#matchAsciiBuffer(java.lang.String,%20byte[])">matchAsciiBuffer</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;expected,
  182. byte[]&nbsp;buffer)</code>
  183. <div class="block">Check if buffer contents matches Ascii String.</div>
  184. </td>
  185. </tr>
  186. <tr class="rowColor">
  187. <td class="colFirst"><code>static boolean</code></td>
  188. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#matchAsciiBuffer(java.lang.String,%20byte[],%20int,%20int)">matchAsciiBuffer</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;expected,
  189. byte[]&nbsp;buffer,
  190. int&nbsp;offset,
  191. int&nbsp;length)</code>
  192. <div class="block">Check if buffer contents matches Ascii String.</div>
  193. </td>
  194. </tr>
  195. <tr class="altColor">
  196. <td class="colFirst"><code>static <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>
  197. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#sanitize(java.lang.String)">sanitize</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;s)</code>
  198. <div class="block">Returns a "sanitized" version of the string given as arguments,
  199. where sanitized means non-printable characters have been
  200. replaced with a question mark and the outcome is not longer
  201. than 255 chars.</div>
  202. </td>
  203. </tr>
  204. <tr class="rowColor">
  205. <td class="colFirst"><code>static byte[]</code></td>
  206. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#toAsciiBytes(java.lang.String)">toAsciiBytes</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;inputString)</code>
  207. <div class="block">Convert a string to Ascii bytes.</div>
  208. </td>
  209. </tr>
  210. <tr class="altColor">
  211. <td class="colFirst"><code>static <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>
  212. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#toAsciiString(byte[])">toAsciiString</a></strong>(byte[]&nbsp;inputBytes)</code>
  213. <div class="block">Convert an input byte array to a String using the ASCII character set.</div>
  214. </td>
  215. </tr>
  216. <tr class="rowColor">
  217. <td class="colFirst"><code>static <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>
  218. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#toAsciiString(byte[],%20int,%20int)">toAsciiString</a></strong>(byte[]&nbsp;inputBytes,
  219. int&nbsp;offset,
  220. int&nbsp;length)</code>
  221. <div class="block">Convert an input byte array to a String using the ASCII character set.</div>
  222. </td>
  223. </tr>
  224. <tr class="altColor">
  225. <td class="colFirst"><code>static <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>
  226. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html#toString(org.apache.commons.compress.archivers.ArchiveEntry)">toString</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">Generates a string containing the name, isDirectory setting and size of an entry.</div>
  228. </td>
  229. </tr>
  230. </table>
  231. <ul class="blockList">
  232. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  233. <!-- -->
  234. </a>
  235. <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>
  236. <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>
  237. </ul>
  238. </li>
  239. </ul>
  240. </li>
  241. </ul>
  242. </div>
  243. <div class="details">
  244. <ul class="blockList">
  245. <li class="blockList">
  246. <!-- ============ METHOD DETAIL ========== -->
  247. <ul class="blockList">
  248. <li class="blockList"><a name="method_detail">
  249. <!-- -->
  250. </a>
  251. <h3>Method Detail</h3>
  252. <a name="toString(org.apache.commons.compress.archivers.ArchiveEntry)">
  253. <!-- -->
  254. </a>
  255. <ul class="blockList">
  256. <li class="blockList">
  257. <h4>toString</h4>
  258. <pre>public static&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/utils/ArchiveUtils.html#line.49">toString</a>(<a href="../../../../../org/apache/commons/compress/archivers/ArchiveEntry.html" title="interface in org.apache.commons.compress.archivers">ArchiveEntry</a>&nbsp;entry)</pre>
  259. <div class="block">Generates a string containing the name, isDirectory setting and size of an entry.
  260. <p>
  261. For example:
  262. <pre>
  263. - 2000 main.c
  264. d 100 testfiles
  265. </pre></div>
  266. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>entry</code> - the entry</dd>
  267. <dt><span class="strong">Returns:</span></dt><dd>the representation of the entry</dd></dl>
  268. </li>
  269. </ul>
  270. <a name="matchAsciiBuffer(java.lang.String, byte[], int, int)">
  271. <!-- -->
  272. </a>
  273. <ul class="blockList">
  274. <li class="blockList">
  275. <h4>matchAsciiBuffer</h4>
  276. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.72">matchAsciiBuffer</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;expected,
  277. byte[]&nbsp;buffer,
  278. int&nbsp;offset,
  279. int&nbsp;length)</pre>
  280. <div class="block">Check if buffer contents matches Ascii String.</div>
  281. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>expected</code> - expected string</dd><dd><code>buffer</code> - the buffer</dd><dd><code>offset</code> - offset to read from</dd><dd><code>length</code> - length of the buffer</dd>
  282. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer is the same as the expected string</dd></dl>
  283. </li>
  284. </ul>
  285. <a name="matchAsciiBuffer(java.lang.String, byte[])">
  286. <!-- -->
  287. </a>
  288. <ul class="blockList">
  289. <li class="blockList">
  290. <h4>matchAsciiBuffer</h4>
  291. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.91">matchAsciiBuffer</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;expected,
  292. byte[]&nbsp;buffer)</pre>
  293. <div class="block">Check if buffer contents matches Ascii String.</div>
  294. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>expected</code> - the expected strin</dd><dd><code>buffer</code> - the buffer</dd>
  295. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer is the same as the expected string</dd></dl>
  296. </li>
  297. </ul>
  298. <a name="toAsciiBytes(java.lang.String)">
  299. <!-- -->
  300. </a>
  301. <ul class="blockList">
  302. <li class="blockList">
  303. <h4>toAsciiBytes</h4>
  304. <pre>public static&nbsp;byte[]&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.102">toAsciiBytes</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;inputString)</pre>
  305. <div class="block">Convert a string to Ascii bytes.
  306. Used for comparing "magic" strings which need to be independent of the default Locale.</div>
  307. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>inputString</code> - string to convert</dd>
  308. <dt><span class="strong">Returns:</span></dt><dd>the bytes</dd></dl>
  309. </li>
  310. </ul>
  311. <a name="toAsciiString(byte[])">
  312. <!-- -->
  313. </a>
  314. <ul class="blockList">
  315. <li class="blockList">
  316. <h4>toAsciiString</h4>
  317. <pre>public static&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/utils/ArchiveUtils.html#line.117">toAsciiString</a>(byte[]&nbsp;inputBytes)</pre>
  318. <div class="block">Convert an input byte array to a String using the ASCII character set.</div>
  319. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>inputBytes</code> - bytes to convert</dd>
  320. <dt><span class="strong">Returns:</span></dt><dd>the bytes, interpreted as an Ascii string</dd></dl>
  321. </li>
  322. </ul>
  323. <a name="toAsciiString(byte[], int, int)">
  324. <!-- -->
  325. </a>
  326. <ul class="blockList">
  327. <li class="blockList">
  328. <h4>toAsciiString</h4>
  329. <pre>public static&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/utils/ArchiveUtils.html#line.134">toAsciiString</a>(byte[]&nbsp;inputBytes,
  330. int&nbsp;offset,
  331. int&nbsp;length)</pre>
  332. <div class="block">Convert an input byte array to a String using the ASCII character set.</div>
  333. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>inputBytes</code> - input byte array</dd><dd><code>offset</code> - offset within array</dd><dd><code>length</code> - length of array</dd>
  334. <dt><span class="strong">Returns:</span></dt><dd>the bytes, interpreted as an Ascii string</dd></dl>
  335. </li>
  336. </ul>
  337. <a name="isEqual(byte[], int, int, byte[], int, int, boolean)">
  338. <!-- -->
  339. </a>
  340. <ul class="blockList">
  341. <li class="blockList">
  342. <h4>isEqual</h4>
  343. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.155">isEqual</a>(byte[]&nbsp;buffer1,
  344. int&nbsp;offset1,
  345. int&nbsp;length1,
  346. byte[]&nbsp;buffer2,
  347. int&nbsp;offset2,
  348. int&nbsp;length2,
  349. boolean&nbsp;ignoreTrailingNulls)</pre>
  350. <div class="block">Compare byte buffers, optionally ignoring trailing nulls</div>
  351. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer1</code> - first buffer</dd><dd><code>offset1</code> - first offset</dd><dd><code>length1</code> - first length</dd><dd><code>buffer2</code> - second buffer</dd><dd><code>offset2</code> - second offset</dd><dd><code>length2</code> - second length</dd><dd><code>ignoreTrailingNulls</code> - whether to ignore trailing nulls</dd>
  352. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer1 and buffer2 have same contents, having regard to trailing nulls</dd></dl>
  353. </li>
  354. </ul>
  355. <a name="isEqual(byte[], int, int, byte[], int, int)">
  356. <!-- -->
  357. </a>
  358. <ul class="blockList">
  359. <li class="blockList">
  360. <h4>isEqual</h4>
  361. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.198">isEqual</a>(byte[]&nbsp;buffer1,
  362. int&nbsp;offset1,
  363. int&nbsp;length1,
  364. byte[]&nbsp;buffer2,
  365. int&nbsp;offset2,
  366. int&nbsp;length2)</pre>
  367. <div class="block">Compare byte buffers</div>
  368. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer1</code> - the first buffer</dd><dd><code>offset1</code> - the first offset</dd><dd><code>length1</code> - the first length</dd><dd><code>buffer2</code> - the second buffer</dd><dd><code>offset2</code> - the second offset</dd><dd><code>length2</code> - the second length</dd>
  369. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer1 and buffer2 have same contents</dd></dl>
  370. </li>
  371. </ul>
  372. <a name="isEqual(byte[], byte[])">
  373. <!-- -->
  374. </a>
  375. <ul class="blockList">
  376. <li class="blockList">
  377. <h4>isEqual</h4>
  378. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.211">isEqual</a>(byte[]&nbsp;buffer1,
  379. byte[]&nbsp;buffer2)</pre>
  380. <div class="block">Compare byte buffers</div>
  381. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer1</code> - the first buffer</dd><dd><code>buffer2</code> - the second buffer</dd>
  382. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer1 and buffer2 have same contents</dd></dl>
  383. </li>
  384. </ul>
  385. <a name="isEqual(byte[], byte[], boolean)">
  386. <!-- -->
  387. </a>
  388. <ul class="blockList">
  389. <li class="blockList">
  390. <h4>isEqual</h4>
  391. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.223">isEqual</a>(byte[]&nbsp;buffer1,
  392. byte[]&nbsp;buffer2,
  393. boolean&nbsp;ignoreTrailingNulls)</pre>
  394. <div class="block">Compare byte buffers, optionally ignoring trailing nulls</div>
  395. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer1</code> - the first buffer</dd><dd><code>buffer2</code> - the second buffer</dd><dd><code>ignoreTrailingNulls</code> - whether to ignore tariling nulls</dd>
  396. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer1 and buffer2 have same contents</dd></dl>
  397. </li>
  398. </ul>
  399. <a name="isEqualWithNull(byte[], int, int, byte[], int, int)">
  400. <!-- -->
  401. </a>
  402. <ul class="blockList">
  403. <li class="blockList">
  404. <h4>isEqualWithNull</h4>
  405. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.238">isEqualWithNull</a>(byte[]&nbsp;buffer1,
  406. int&nbsp;offset1,
  407. int&nbsp;length1,
  408. byte[]&nbsp;buffer2,
  409. int&nbsp;offset2,
  410. int&nbsp;length2)</pre>
  411. <div class="block">Compare byte buffers, ignoring trailing nulls</div>
  412. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer1</code> - the first buffer</dd><dd><code>offset1</code> - the first offset</dd><dd><code>length1</code> - the first length</dd><dd><code>buffer2</code> - the second buffer</dd><dd><code>offset2</code> - the second offset</dd><dd><code>length2</code> - the second length</dd>
  413. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if buffer1 and buffer2 have same contents, having regard to trailing nulls</dd></dl>
  414. </li>
  415. </ul>
  416. <a name="isArrayZero(byte[], int)">
  417. <!-- -->
  418. </a>
  419. <ul class="blockList">
  420. <li class="blockList">
  421. <h4>isArrayZero</h4>
  422. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/ArchiveUtils.html#line.253">isArrayZero</a>(byte[]&nbsp;a,
  423. int&nbsp;size)</pre>
  424. <div class="block">Returns true if the first N bytes of an array are all zero</div>
  425. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - The array to check</dd><dd><code>size</code> - The number of characters to check (not the size of the array)</dd>
  426. <dt><span class="strong">Returns:</span></dt><dd>true if the first N bytes are zero</dd></dl>
  427. </li>
  428. </ul>
  429. <a name="sanitize(java.lang.String)">
  430. <!-- -->
  431. </a>
  432. <ul class="blockListLast">
  433. <li class="blockList">
  434. <h4>sanitize</h4>
  435. <pre>public static&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/utils/ArchiveUtils.html#line.277">sanitize</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;s)</pre>
  436. <div class="block">Returns a "sanitized" version of the string given as arguments,
  437. where sanitized means non-printable characters have been
  438. replaced with a question mark and the outcome is not longer
  439. than 255 chars.
  440. <p>This method is used to clean up file names when they are
  441. used in exception messages as they may end up in log files or
  442. as console output and may have been read from a corrupted
  443. input.</p></div>
  444. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - the string to sanitize</dd>
  445. <dt><span class="strong">Returns:</span></dt><dd>a sanitized version of the argument</dd><dt><span class="strong">Since:</span></dt>
  446. <dd>Compress 1.12</dd></dl>
  447. </li>
  448. </ul>
  449. </li>
  450. </ul>
  451. </li>
  452. </ul>
  453. </div>
  454. </div>
  455. <!-- ========= END OF CLASS DATA ========= -->
  456. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  457. <div class="bottomNav"><a name="navbar_bottom">
  458. <!-- -->
  459. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  460. <!-- -->
  461. </a>
  462. <ul class="navList" title="Navigation">
  463. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  464. <li><a href="package-summary.html">Package</a></li>
  465. <li class="navBarCell1Rev">Class</li>
  466. <li><a href="class-use/ArchiveUtils.html">Use</a></li>
  467. <li><a href="package-tree.html">Tree</a></li>
  468. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  469. <li><a href="../../../../../index-all.html">Index</a></li>
  470. <li><a href="../../../../../help-doc.html">Help</a></li>
  471. </ul>
  472. </div>
  473. <div class="subNav">
  474. <ul class="navList">
  475. <li>Prev Class</li>
  476. <li><a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html" title="class in org.apache.commons.compress.utils"><span class="strong">Next Class</span></a></li>
  477. </ul>
  478. <ul class="navList">
  479. <li><a href="../../../../../index.html?org/apache/commons/compress/utils/ArchiveUtils.html" target="_top">Frames</a></li>
  480. <li><a href="ArchiveUtils.html" target="_top">No Frames</a></li>
  481. </ul>
  482. <ul class="navList" id="allclasses_navbar_bottom">
  483. <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
  484. </ul>
  485. <div>
  486. <script type="text/javascript"><!--
  487. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  488. if(window==top) {
  489. allClassesLink.style.display = "block";
  490. }
  491. else {
  492. allClassesLink.style.display = "none";
  493. }
  494. //-->
  495. </script>
  496. </div>
  497. <div>
  498. <ul class="subNavList">
  499. <li>Summary:&nbsp;</li>
  500. <li>Nested&nbsp;|&nbsp;</li>
  501. <li>Field&nbsp;|&nbsp;</li>
  502. <li>Constr&nbsp;|&nbsp;</li>
  503. <li><a href="#method_summary">Method</a></li>
  504. </ul>
  505. <ul class="subNavList">
  506. <li>Detail:&nbsp;</li>
  507. <li>Field&nbsp;|&nbsp;</li>
  508. <li>Constr&nbsp;|&nbsp;</li>
  509. <li><a href="#method_detail">Method</a></li>
  510. </ul>
  511. </div>
  512. <a name="skip-navbar_bottom">
  513. <!-- -->
  514. </a></div>
  515. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  516. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  517. </body>
  518. </html>