629 lines
24 KiB
HTML
Raw Normal View History

2019-05-13 16:45:05 +04:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_07) on Fri Mar 13 20:01:31 CET 2009 -->
<TITLE>
Base64 (Rice Pastry - API Specifications)
</TITLE>
<META NAME="date" CONTENT="2009-03-13">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Base64 (Rice Pastry - API Specifications)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" 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_top_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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Base64.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Rice Pastry API</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../rice/p2p/util/AttachableCancellable.html" title="class in rice.p2p.util"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../rice/p2p/util/Base64.InputStream.html" title="class in rice.p2p.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?rice/p2p/util/Base64.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Base64.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
rice.p2p.util</FONT>
<BR>
Class Base64</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>rice.p2p.util.Base64</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Base64</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.InputStream.html" title="class in rice.p2p.util">Base64.InputStream</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A <CODE>Base64#InputStream</CODE> will read data from another
<CODE>InputStream</CODE>, given in the constructor,
and encode/decode to/from Base64 notation on the fly.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.OutputStream.html" title="class in rice.p2p.util">Base64.OutputStream</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A <CODE>Base64#OutputStream</CODE> will write data to another
<CODE>OutputStream</CODE>, given in the constructor,
and encode/decode to/from Base64 notation on the fly.</TD>
</TR>
</TABLE>
&nbsp;<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#DECODE">DECODE</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify decoding.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#DONT_BREAK_LINES">DONT_BREAK_LINES</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Don't break lines when encoding (violates strict Base64 specification)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#ENCODE">ENCODE</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify encoding.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#GZIP">GZIP</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify that data should be gzip-compressed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#NO_OPTIONS">NO_OPTIONS</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No options specified.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<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="../../../rice/p2p/util/Base64.html#decode(byte[], int, int)">decode</A></B>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Very low-level access to decoding ASCII characters in
the form of a byte array.</TD>
</TR>
<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="../../../rice/p2p/util/Base64.html#decode(java.lang.String)">decode</A></B>(java.lang.String&nbsp;s)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes data from Base64 notation, automatically
detecting gzip-compressed data and decompressing it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#decodeToObject(java.lang.String)">decodeToObject</A></B>(java.lang.String&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;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/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;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/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;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/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;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/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;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#encodeObject(java.io.Serializable)">encodeObject</A></B>(java.io.Serializable&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;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/p2p/util/Base64.html#encodeObject(java.io.Serializable, int)">encodeObject</A></B>(java.io.Serializable&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>
</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.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</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#rice.p2p.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#rice.p2p.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#rice.p2p.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#rice.p2p.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#rice.p2p.util.Base64.DONT_BREAK_LINES">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="encodeObject(java.io.Serializable)"><!-- --></A><H3>
encodeObject</H3>
<PRE>
public static java.lang.String <B>encodeObject</B>(java.io.Serializable&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 java.lang.String <B>encodeObject</B>(java.io.Serializable&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
<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="../../../rice/p2p/util/Base64.html#GZIP"><CODE>GZIP</CODE></A>,
<A HREF="../../../rice/p2p/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 java.lang.String <B>encodeBytes</B>(byte[]&nbsp;source)</PRE>
<DL>
<DD>Encodes a byte array into Base64 notation.
Does not GZip-compress data.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The data to convert<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="encodeBytes(byte[], int)"><!-- --></A><H3>
encodeBytes</H3>
<PRE>
public static java.lang.String <B>encodeBytes</B>(byte[]&nbsp;source,
int&nbsp;options)</PRE>
<DL>
<DD>Encodes a byte array into Base64 notation.
<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>encodeBytes( myData, Base64.GZIP )</code> or
<p>
Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The data to convert<DD><CODE>options</CODE> - Specified options<DT><B>Since:</B></DT>
<DD>2.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../../rice/p2p/util/Base64.html#GZIP"><CODE>GZIP</CODE></A>,
<A HREF="../../../rice/p2p/util/Base64.html#DONT_BREAK_LINES"><CODE>DONT_BREAK_LINES</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="encodeBytes(byte[], int, int)"><!-- --></A><H3>
encodeBytes</H3>
<PRE>
public static java.lang.String <B>encodeBytes</B>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len)</PRE>
<DL>
<DD>Encodes a byte array into Base64 notation.
Does not GZip-compress data.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The data to convert<DD><CODE>off</CODE> - Offset in array where conversion should begin<DD><CODE>len</CODE> - Length of data to convert<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="encodeBytes(byte[], int, int, int)"><!-- --></A><H3>
encodeBytes</H3>
<PRE>
public static java.lang.String <B>encodeBytes</B>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)</PRE>
<DL>
<DD>Encodes a byte array into Base64 notation.
<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>encodeBytes( myData, Base64.GZIP )</code> or
<p>
Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The data to convert<DD><CODE>off</CODE> - Offset in array where conversion should begin<DD><CODE>len</CODE> - Length of data to convert<DD><CODE>breakLines</CODE> - Break lines at 80 characters or less.<DD><CODE>options</CODE> - Specified options<DT><B>Since:</B></DT>
<DD>2.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../../rice/p2p/util/Base64.html#GZIP"><CODE>GZIP</CODE></A>,
<A HREF="../../../rice/p2p/util/Base64.html#DONT_BREAK_LINES"><CODE>DONT_BREAK_LINES</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="decode(byte[], int, int)"><!-- --></A><H3>
decode</H3>
<PRE>
public static byte[] <B>decode</B>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len)</PRE>
<DL>
<DD>Very low-level access to decoding ASCII characters in
the form of a byte array. Does not support automatically
gunzipping or any other "fancy" features.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The Base64 encoded data<DD><CODE>off</CODE> - The offset of where to begin decoding<DD><CODE>len</CODE> - The length of characters to decode
<DT><B>Returns:</B><DD>decoded data<DT><B>Since:</B></DT>
<DD>1.3</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="decode(java.lang.String)"><!-- --></A><H3>
decode</H3>
<PRE>
public static byte[] <B>decode</B>(java.lang.String&nbsp;s)</PRE>
<DL>
<DD>Decodes data from Base64 notation, automatically
detecting gzip-compressed data and decompressing it.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - the string to decode
<DT><B>Returns:</B><DD>the decoded data<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="decodeToObject(java.lang.String)"><!-- --></A><H3>
decodeToObject</H3>
<PRE>
public static java.lang.Object <B>decodeToObject</B>(java.lang.String&nbsp;encodedObject)</PRE>
<DL>
<DD>Attempts to decode Base64 data and deserialize a Java
Object within. Returns <tt>null</tt> if there was an error.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>encodedObject</CODE> - The Base64 data to decode
<DT><B>Returns:</B><DD>The decoded and deserialized object<DT><B>Since:</B></DT>
<DD>1.5</DD>
</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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Base64.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Rice Pastry API</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../rice/p2p/util/AttachableCancellable.html" title="class in rice.p2p.util"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../rice/p2p/util/Base64.InputStream.html" title="class in rice.p2p.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?rice/p2p/util/Base64.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Base64.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright &#169; 2001-2005 - Rice Pastry.</i>
</BODY>
</HTML>