⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 base64.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#decodeFromFile(java.lang.String)">decodeFromFile</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;filename)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method for reading a base64-encoded file and decoding it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#decodeToFile(java.lang.String, java.lang.String)">decodeToFile</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;dataToDecode,             <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;filename)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method for decoding data to a file.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#decodeToObject(java.lang.String)">decodeToObject</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;encodedObject)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempts to decode Base64 data and deserialize a Java Object within.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeBytes(byte[])">encodeBytes</A></B>(byte[]&nbsp;source)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a byte array into Base64 notation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeBytes(byte[], int)">encodeBytes</A></B>(byte[]&nbsp;source,            int&nbsp;options)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a byte array into Base64 notation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeBytes(byte[], int, int)">encodeBytes</A></B>(byte[]&nbsp;source,            int&nbsp;off,            int&nbsp;len)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a byte array into Base64 notation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeBytes(byte[], int, int, int)">encodeBytes</A></B>(byte[]&nbsp;source,            int&nbsp;off,            int&nbsp;len,            int&nbsp;options)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a byte array into Base64 notation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeFileToFile(java.lang.String, java.lang.String)">encodeFileToFile</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;infile,                 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;outfile)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeFromFile(java.lang.String)">encodeFromFile</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;filename)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method for reading a binary file and base64-encoding it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeObject(java.io.Serializable)">encodeObject</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A>&nbsp;serializableObject)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes an object and returns the Base64-encoded version of that serialized object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeObject(java.io.Serializable, int)">encodeObject</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A>&nbsp;serializableObject,             int&nbsp;options)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes an object and returns the Base64-encoded version of that serialized object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#encodeToFile(byte[], java.lang.String)">encodeToFile</A></B>(byte[]&nbsp;dataToEncode,             <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;filename)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method for encoding data to a file.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/util/Base64.html#main(java.lang.String[])">main</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;args)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes or decodes two files from the command line; <strong>feel free to delete this method (in fact you probably should) if you're embedding this code into a larger program.</strong></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="NO_OPTIONS"><!-- --></A><H3>NO_OPTIONS</H3><PRE>public static final int <B>NO_OPTIONS</B></PRE><DL><DD>No options specified. Value is zero.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.NO_OPTIONS">Constant Field Values</A></DL></DL><HR><A NAME="ENCODE"><!-- --></A><H3>ENCODE</H3><PRE>public static final int <B>ENCODE</B></PRE><DL><DD>Specify encoding.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.ENCODE">Constant Field Values</A></DL></DL><HR><A NAME="DECODE"><!-- --></A><H3>DECODE</H3><PRE>public static final int <B>DECODE</B></PRE><DL><DD>Specify decoding.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.DECODE">Constant Field Values</A></DL></DL><HR><A NAME="GZIP"><!-- --></A><H3>GZIP</H3><PRE>public static final int <B>GZIP</B></PRE><DL><DD>Specify that data should be gzip-compressed.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.GZIP">Constant Field Values</A></DL></DL><HR><A NAME="DONT_BREAK_LINES"><!-- --></A><H3>DONT_BREAK_LINES</H3><PRE>public static final int <B>DONT_BREAK_LINES</B></PRE><DL><DD>Don't break lines when encoding (violates strict Base64 specification)<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.DONT_BREAK_LINES">Constant Field Values</A></DL></DL><HR><A NAME="URL_SAFE"><!-- --></A><H3>URL_SAFE</H3><PRE>public static final int <B>URL_SAFE</B></PRE><DL><DD>Encode using Base64-like encoding that is URL- and Filename-safe as described in Section 4 of RFC3548: <a href="http://www.faqs.org/rfcs/rfc3548.html">http://www.faqs.org/rfcs/rfc3548.html</a>. It is important to note that data encoded this way is <em>not</em> officially valid Base64, or at the very least should not be called Base64 without also specifying that is was encoded using the URL- and Filename-safe dialect.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.URL_SAFE">Constant Field Values</A></DL></DL><HR><A NAME="ORDERED"><!-- --></A><H3>ORDERED</H3><PRE>public static final int <B>ORDERED</B></PRE><DL><DD>Encode using the special "ordered" dialect of Base64 described here: <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.jivesoftware.util.Base64.ORDERED">Constant Field Values</A></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static final void <B>main</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]&nbsp;args)</PRE><DL><DD>Encodes or decodes two files from the command line; <strong>feel free to delete this method (in fact you probably should) if you're embedding this code into a larger program.</strong><P><DD><DL></DL></DD></DL><HR><A NAME="encodeObject(java.io.Serializable)"><!-- --></A><H3>encodeObject</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeObject</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A>&nbsp;serializableObject)</PRE><DL><DD>Serializes an object and returns the Base64-encoded version of that serialized object. If the object cannot be serialized or there is another error, the method will return <tt>null</tt>. The object is not GZip-compressed before being encoded.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>serializableObject</CODE> - The object to encode<DT><B>Returns:</B><DD>The Base64-encoded object<DT><B>Since:</B></DT>  <DD>1.4</DD></DL></DD></DL><HR><A NAME="encodeObject(java.io.Serializable, int)"><!-- --></A><H3>encodeObject</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeObject</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A>&nbsp;serializableObject,                                  int&nbsp;options)</PRE><DL><DD>Serializes an object and returns the Base64-encoded version of that serialized object. If the object cannot be serialized or there is another error, the method will return <tt>null</tt>. <p> Valid options:<pre>   GZIP: gzip-compresses object before encoding it.   DONT_BREAK_LINES: don't break lines at 76 characters     <i>Note: Technically, this makes your encoding non-compliant.</i> </pre> <p> Example: <code>encodeObject( myObj, Base64.GZIP )</code> or <p> Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DONT_BREAK_LINES )</code><P><DD><DL><DT><B>Parameters:</B><DD><CODE>serializableObject</CODE> - The object to encode<DD><CODE>options</CODE> - Specified options<DT><B>Returns:</B><DD>The Base64-encoded object<DT><B>Since:</B></DT>  <DD>2.0</DD><DT><B>See Also:</B><DD><A HREF="../../../org/jivesoftware/util/Base64.html#GZIP"><CODE>GZIP</CODE></A>, <A HREF="../../../org/jivesoftware/util/Base64.html#DONT_BREAK_LINES"><CODE>DONT_BREAK_LINES</CODE></A></DL></DD></DL><HR><A NAME="encodeBytes(byte[])"><!-- --></A><H3>encodeBytes</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeBytes</B>(byte[]&nbsp;source)</PRE><DL><DD>Encodes a byte array into Base64 notation. Does not GZip-compress data.<P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -