?? archiveutils.html
字號:
<A NAME="padTo(java.lang.String, int)"><!-- --></A><H3>padTo</H3><PRE>public static java.lang.String <B>padTo</B>(java.lang.String s, int pad)</PRE><DL><DD>Pad the given <code>String</code> to <code>pad</code> characters wide by pre-pending spaces. <code>s</code> should not be <code>null</code>. If <code>s</code> is already wider than <code>pad</code> no change is done.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String to pad<DD><CODE>pad</CODE> - the width to pad to.<DT><B>Returns:</B><DD>String w/ padding.</DL></DD></DL><HR><A NAME="padTo(java.lang.String, int, char)"><!-- --></A><H3>padTo</H3><PRE>public static java.lang.String <B>padTo</B>(java.lang.String s, int pad, char padChar)</PRE><DL><DD>Pad the given <code>String</code> to <code>pad</code> characters wide by pre-pending <code>padChar</code>. <code>s</code> should not be <code>null</code>. If <code>s</code> is already wider than <code>pad</code> no change is done.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the String to pad<DD><CODE>pad</CODE> - the width to pad to.<DD><CODE>padChar</CODE> - The pad character to use.<DT><B>Returns:</B><DD>String w/ padding.</DL></DD></DL><HR><A NAME="byteArrayEquals(byte[], byte[])"><!-- --></A><H3>byteArrayEquals</H3><PRE>public static boolean <B>byteArrayEquals</B>(byte[] lhs, byte[] rhs)</PRE><DL><DD>check that two byte arrays are equal. They may be <code>null</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>lhs</CODE> - a byte array<DD><CODE>rhs</CODE> - another byte array.<DT><B>Returns:</B><DD><code>true</code> if they are both equal (or both <code>null</code>)</DL></DD></DL><HR><A NAME="doubleToString(double, int)"><!-- --></A><H3>doubleToString</H3><PRE>public static java.lang.String <B>doubleToString</B>(double val, int maxFractionDigits)</PRE><DL><DD>Converts a double to a string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - The double to convert<DD><CODE>precision</CODE> - How many characters to include after '.'<DT><B>Returns:</B><DD>the double as a string.</DL></DD></DL><HR><A NAME="formatBytesForDisplay(long)"><!-- --></A><H3>formatBytesForDisplay</H3><PRE>public static java.lang.String <B>formatBytesForDisplay</B>(long amount)</PRE><DL><DD>Takes a byte size and formats it for display with 'friendly' units. <p> This involves converting it to the largest unit (of B, KB, MB, GB, TB) for which the amount will be > 1. <p> Additionally, at least 2 significant digits are always displayed. <p> Displays as bytes (B): 0-1023 Displays as kilobytes (KB): 1024 - 2097151 (~2Mb) Displays as megabytes (MB): 2097152 - 4294967295 (~4Gb) Displays as gigabytes (GB): 4294967296 - infinity <p> Negative numbers will be returned as '0 B'.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>amount</CODE> - the amount of bytes<DT><B>Returns:</B><DD>A string containing the amount, properly formated.</DL></DD></DL><HR><A NAME="formatMillisecondsToConventional(long)"><!-- --></A><H3>formatMillisecondsToConventional</H3><PRE>public static java.lang.String <B>formatMillisecondsToConventional</B>(long time)</PRE><DL><DD>Convert milliseconds value to a human-readable duration<P><DD><DL><DT><B>Parameters:</B><DD><CODE>time</CODE> - <DT><B>Returns:</B><DD>Human readable string version of passed <code>time</code></DL></DD></DL><HR><A NAME="formatMillisecondsToConventional(long, boolean)"><!-- --></A><H3>formatMillisecondsToConventional</H3><PRE>public static java.lang.String <B>formatMillisecondsToConventional</B>(long time, boolean toMs)</PRE><DL><DD>Convert milliseconds value to a human-readable duration<P><DD><DL><DT><B>Parameters:</B><DD><CODE>time</CODE> - <DD><CODE>toMs</CODE> - whether to print to the ms<DT><B>Returns:</B><DD>Human readable string version of passed <code>time</code></DL></DD></DL><HR><A NAME="classnameBasedUID(java.lang.Class, int)"><!-- --></A><H3>classnameBasedUID</H3><PRE>public static long <B>classnameBasedUID</B>(java.lang.Class class1, int version)</PRE><DL><DD>Generate a long UID based on the given class and version number. Using this instead of the default will assume serialization compatibility across class changes unless version number is intentionally bumped.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>class1</CODE> - <DD><CODE>version</CODE> - <DT><B>Returns:</B><DD>UID based off class and version number.</DL></DD></DL><HR><A NAME="longIntoByteArray(long, byte[], int)"><!-- --></A><H3>longIntoByteArray</H3><PRE>public static void <B>longIntoByteArray</B>(long l, byte[] array, int offset)</PRE><DL><DD>Copy the raw bytes of a long into a byte array, starting at the specified offset.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - <DD><CODE>array</CODE> - <DD><CODE>offset</CODE> - </DL></DD></DL><HR><A NAME="byteArrayIntoLong(byte[])"><!-- --></A><H3>byteArrayIntoLong</H3><PRE>public static long <B>byteArrayIntoLong</B>(byte[] bytearray)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="byteArrayIntoLong(byte[], int)"><!-- --></A><H3>byteArrayIntoLong</H3><PRE>public static long <B>byteArrayIntoLong</B>(byte[] bytearray, int offset)</PRE><DL><DD>Byte array into long.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bytearray</CODE> - Array to convert to a long.<DD><CODE>offset</CODE> - Offset into array at which we start decoding the long.<DT><B>Returns:</B><DD>Long made of the bytes of <code>array</code> beginning at offset <code>offset</code>.<DT><B>See Also:</B><DD><A HREF="../../../org/archive/util/ArchiveUtils.html#longIntoByteArray(long, byte[], int)"><CODE>longIntoByteArray(long, byte[], int)</CODE></A></DL></DD></DL><HR><A NAME="addImpliedHttpIfNecessary(java.lang.String)"><!-- --></A><H3>addImpliedHttpIfNecessary</H3><PRE>public static java.lang.String <B>addImpliedHttpIfNecessary</B>(java.lang.String u)</PRE><DL><DD>Given a string that may be a plain host or host/path (without URI scheme), add an implied http:// if necessary.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>u</CODE> - string to evaluate<DT><B>Returns:</B><DD>string with http:// added if no scheme already present</DL></DD></DL><HR><A NAME="startsWith(byte[], byte[])"><!-- --></A><H3>startsWith</H3><PRE>public static boolean <B>startsWith</B>(byte[] array, byte[] prefix)</PRE><DL><DD>Verify that the array begins with the prefix.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - <DD><CODE>prefix</CODE> - <DT><B>Returns:</B><DD>true if array is identical to prefix for the first prefix.length positions</DL></DD></DL><HR><A NAME="singleLineReport(org.archive.util.Reporter)"><!-- --></A><H3>singleLineReport</H3><PRE>public static java.lang.String <B>singleLineReport</B>(<A HREF="../../../org/archive/util/Reporter.html" title="interface in org.archive.util">Reporter</A> rep)</PRE><DL><DD>Utility method to get a String singleLineReport from Reporter<P><DD><DL><DT><B>Parameters:</B><DD><CODE>rep</CODE> - Reporter to get singleLineReport from<DT><B>Returns:</B><DD>String of report</DL></DD></DL><HR><A NAME="writeReportToString(org.archive.util.Reporter, java.lang.String)"><!-- --></A><H3>writeReportToString</H3><PRE>public static java.lang.String <B>writeReportToString</B>(<A HREF="../../../org/archive/util/Reporter.html" title="interface in org.archive.util">Reporter</A> rep, java.lang.String name)</PRE><DL><DD>Compose the requested report into a String. DANGEROUS IF REPORT CAN BE LARGE.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>rep</CODE> - Reported<DD><CODE>name</CODE> - String name of report to compose<DT><B>Returns:</B><DD>String of report</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ArchiveUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/archive/util/Accumulator.html" title="interface in org.archive.util"><B>PREV CLASS</B></A> <A HREF="../../../org/archive/util/Base32.html" title="class in org.archive.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/archive/util/ArchiveUtils.html" target="_top"><B>FRAMES</B></A> <A HREF="ArchiveUtils.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 2003-2007 Internet Archive. All Rights Reserved.</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -