/lib/bouncycastle/docs/org/bouncycastle/util/encoders/Base64.html

https://bitbucket.org/arkban/somersault · HTML · 384 lines · 315 code · 47 blank · 22 comment · 0 complexity · dd16dd3a2e4af9d2053c21603e8835d3 MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0) on Mon Jan 11 13:46:41 EST 2010 -->
  6. <TITLE>
  7. Base64 (Bouncy Castle Library 1.45 API Specification)
  8. </TITLE>
  9. <META NAME="date" CONTENT="2010-01-11">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="Base64 (Bouncy Castle Library 1.45 API Specification)";
  16. }
  17. }
  18. </SCRIPT>
  19. <NOSCRIPT>
  20. </NOSCRIPT>
  21. </HEAD>
  22. <BODY BGCOLOR="white" onload="windowTitle();">
  23. <HR>
  24. <!-- ========= START OF TOP NAVBAR ======= -->
  25. <A NAME="navbar_top"><!-- --></A>
  26. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  27. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  28. <TR>
  29. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  30. <A NAME="navbar_top_firstrow"><!-- --></A>
  31. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  32. <TR ALIGN="center" VALIGN="top">
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  35. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  36. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  37. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  38. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  39. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  40. </TR>
  41. </TABLE>
  42. </TD>
  43. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  44. <b>Bouncy Castle Cryptography Library 1.45</b></EM>
  45. </TD>
  46. </TR>
  47. <TR>
  48. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  49. &nbsp;PREV CLASS&nbsp;
  50. &nbsp;<A HREF="../../../../org/bouncycastle/util/encoders/Base64Encoder.html" title="class in org.bouncycastle.util.encoders"><B>NEXT CLASS</B></A></FONT></TD>
  51. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  52. <A HREF="../../../../index.html?org/bouncycastle/util/encoders/Base64.html" target="_top"><B>FRAMES</B></A> &nbsp;
  53. &nbsp;<A HREF="Base64.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  54. &nbsp;<SCRIPT type="text/javascript">
  55. <!--
  56. if(window==top) {
  57. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  58. }
  59. //-->
  60. </SCRIPT>
  61. <NOSCRIPT>
  62. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  63. </NOSCRIPT>
  64. </FONT></TD>
  65. </TR>
  66. <TR>
  67. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  68. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  69. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  70. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  71. </TR>
  72. </TABLE>
  73. <A NAME="skip-navbar_top"></A>
  74. <!-- ========= END OF TOP NAVBAR ========= -->
  75. <HR>
  76. <!-- ======== START OF CLASS DATA ======== -->
  77. <H2>
  78. <FONT SIZE="-1">
  79. org.bouncycastle.util.encoders</FONT>
  80. <BR>
  81. Class Base64</H2>
  82. <PRE>
  83. java.lang.Object
  84. <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.bouncycastle.util.encoders.Base64</B>
  85. </PRE>
  86. <HR>
  87. <DL>
  88. <DT><PRE>public class <B>Base64</B><DT>extends java.lang.Object</DL>
  89. </PRE>
  90. <P>
  91. <HR>
  92. <P>
  93. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  94. <A NAME="constructor_summary"><!-- --></A>
  95. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  96. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  97. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  98. <B>Constructor Summary</B></FONT></TH>
  99. </TR>
  100. <TR BGCOLOR="white" CLASS="TableRowColor">
  101. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#Base64()">Base64</A></B>()</CODE>
  102. <BR>
  103. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  104. </TR>
  105. </TABLE>
  106. &nbsp;
  107. <!-- ========== METHOD SUMMARY =========== -->
  108. <A NAME="method_summary"><!-- --></A>
  109. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  110. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  111. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  112. <B>Method Summary</B></FONT></TH>
  113. </TR>
  114. <TR BGCOLOR="white" CLASS="TableRowColor">
  115. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  116. <CODE>static&nbsp;byte[]</CODE></FONT></TD>
  117. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#decode(byte[])">decode</A></B>(byte[]&nbsp;data)</CODE>
  118. <BR>
  119. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decode the base 64 encoded input data.</TD>
  120. </TR>
  121. <TR BGCOLOR="white" CLASS="TableRowColor">
  122. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  123. <CODE>static&nbsp;byte[]</CODE></FONT></TD>
  124. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#decode(java.lang.String)">decode</A></B>(java.lang.String&nbsp;data)</CODE>
  125. <BR>
  126. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decode the base 64 encoded String data - whitespace will be ignored.</TD>
  127. </TR>
  128. <TR BGCOLOR="white" CLASS="TableRowColor">
  129. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  130. <CODE>static&nbsp;int</CODE></FONT></TD>
  131. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#decode(java.lang.String, java.io.OutputStream)">decode</A></B>(java.lang.String&nbsp;data,
  132. java.io.OutputStream&nbsp;out)</CODE>
  133. <BR>
  134. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decode the base 64 encoded String data writing it to the given output stream,
  135. whitespace characters will be ignored.</TD>
  136. </TR>
  137. <TR BGCOLOR="white" CLASS="TableRowColor">
  138. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  139. <CODE>static&nbsp;byte[]</CODE></FONT></TD>
  140. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#encode(byte[])">encode</A></B>(byte[]&nbsp;data)</CODE>
  141. <BR>
  142. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;encode the input data producing a base 64 encoded byte array.</TD>
  143. </TR>
  144. <TR BGCOLOR="white" CLASS="TableRowColor">
  145. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  146. <CODE>static&nbsp;int</CODE></FONT></TD>
  147. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#encode(byte[], int, int, java.io.OutputStream)">encode</A></B>(byte[]&nbsp;data,
  148. int&nbsp;off,
  149. int&nbsp;length,
  150. java.io.OutputStream&nbsp;out)</CODE>
  151. <BR>
  152. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encode the byte data to base 64 writing it to the given output stream.</TD>
  153. </TR>
  154. <TR BGCOLOR="white" CLASS="TableRowColor">
  155. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  156. <CODE>static&nbsp;int</CODE></FONT></TD>
  157. <TD><CODE><B><A HREF="../../../../org/bouncycastle/util/encoders/Base64.html#encode(byte[], java.io.OutputStream)">encode</A></B>(byte[]&nbsp;data,
  158. java.io.OutputStream&nbsp;out)</CODE>
  159. <BR>
  160. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encode the byte data to base 64 writing it to the given output stream.</TD>
  161. </TR>
  162. </TABLE>
  163. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  164. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  165. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  166. <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
  167. </TR>
  168. <TR BGCOLOR="white" CLASS="TableRowColor">
  169. <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
  170. </TR>
  171. </TABLE>
  172. &nbsp;
  173. <P>
  174. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  175. <A NAME="constructor_detail"><!-- --></A>
  176. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  177. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  178. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  179. <B>Constructor Detail</B></FONT></TH>
  180. </TR>
  181. </TABLE>
  182. <A NAME="Base64()"><!-- --></A><H3>
  183. Base64</H3>
  184. <PRE>
  185. public <B>Base64</B>()</PRE>
  186. <DL>
  187. </DL>
  188. <!-- ============ METHOD DETAIL ========== -->
  189. <A NAME="method_detail"><!-- --></A>
  190. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  191. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  192. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  193. <B>Method Detail</B></FONT></TH>
  194. </TR>
  195. </TABLE>
  196. <A NAME="encode(byte[])"><!-- --></A><H3>
  197. encode</H3>
  198. <PRE>
  199. public static byte[] <B>encode</B>(byte[]&nbsp;data)</PRE>
  200. <DL>
  201. <DD>encode the input data producing a base 64 encoded byte array.
  202. <P>
  203. <DD><DL>
  204. <DT><B>Returns:</B><DD>a byte array containing the base 64 encoded data.</DL>
  205. </DD>
  206. </DL>
  207. <HR>
  208. <A NAME="encode(byte[], java.io.OutputStream)"><!-- --></A><H3>
  209. encode</H3>
  210. <PRE>
  211. public static int <B>encode</B>(byte[]&nbsp;data,
  212. java.io.OutputStream&nbsp;out)
  213. throws java.io.IOException</PRE>
  214. <DL>
  215. <DD>Encode the byte data to base 64 writing it to the given output stream.
  216. <P>
  217. <DD><DL>
  218. <DT><B>Returns:</B><DD>the number of bytes produced.
  219. <DT><B>Throws:</B>
  220. <DD><CODE>java.io.IOException</CODE></DL>
  221. </DD>
  222. </DL>
  223. <HR>
  224. <A NAME="encode(byte[], int, int, java.io.OutputStream)"><!-- --></A><H3>
  225. encode</H3>
  226. <PRE>
  227. public static int <B>encode</B>(byte[]&nbsp;data,
  228. int&nbsp;off,
  229. int&nbsp;length,
  230. java.io.OutputStream&nbsp;out)
  231. throws java.io.IOException</PRE>
  232. <DL>
  233. <DD>Encode the byte data to base 64 writing it to the given output stream.
  234. <P>
  235. <DD><DL>
  236. <DT><B>Returns:</B><DD>the number of bytes produced.
  237. <DT><B>Throws:</B>
  238. <DD><CODE>java.io.IOException</CODE></DL>
  239. </DD>
  240. </DL>
  241. <HR>
  242. <A NAME="decode(byte[])"><!-- --></A><H3>
  243. decode</H3>
  244. <PRE>
  245. public static byte[] <B>decode</B>(byte[]&nbsp;data)</PRE>
  246. <DL>
  247. <DD>decode the base 64 encoded input data. It is assumed the input data is valid.
  248. <P>
  249. <DD><DL>
  250. <DT><B>Returns:</B><DD>a byte array representing the decoded data.</DL>
  251. </DD>
  252. </DL>
  253. <HR>
  254. <A NAME="decode(java.lang.String)"><!-- --></A><H3>
  255. decode</H3>
  256. <PRE>
  257. public static byte[] <B>decode</B>(java.lang.String&nbsp;data)</PRE>
  258. <DL>
  259. <DD>decode the base 64 encoded String data - whitespace will be ignored.
  260. <P>
  261. <DD><DL>
  262. <DT><B>Returns:</B><DD>a byte array representing the decoded data.</DL>
  263. </DD>
  264. </DL>
  265. <HR>
  266. <A NAME="decode(java.lang.String, java.io.OutputStream)"><!-- --></A><H3>
  267. decode</H3>
  268. <PRE>
  269. public static int <B>decode</B>(java.lang.String&nbsp;data,
  270. java.io.OutputStream&nbsp;out)
  271. throws java.io.IOException</PRE>
  272. <DL>
  273. <DD>decode the base 64 encoded String data writing it to the given output stream,
  274. whitespace characters will be ignored.
  275. <P>
  276. <DD><DL>
  277. <DT><B>Returns:</B><DD>the number of bytes produced.
  278. <DT><B>Throws:</B>
  279. <DD><CODE>java.io.IOException</CODE></DL>
  280. </DD>
  281. </DL>
  282. <!-- ========= END OF CLASS DATA ========= -->
  283. <HR>
  284. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  285. <A NAME="navbar_bottom"><!-- --></A>
  286. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  287. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  288. <TR>
  289. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  290. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  291. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  292. <TR ALIGN="center" VALIGN="top">
  293. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  294. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  295. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  296. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  297. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  298. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  299. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  300. </TR>
  301. </TABLE>
  302. </TD>
  303. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  304. <b>Bouncy Castle Cryptography Library 1.45</b></EM>
  305. </TD>
  306. </TR>
  307. <TR>
  308. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  309. &nbsp;PREV CLASS&nbsp;
  310. &nbsp;<A HREF="../../../../org/bouncycastle/util/encoders/Base64Encoder.html" title="class in org.bouncycastle.util.encoders"><B>NEXT CLASS</B></A></FONT></TD>
  311. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  312. <A HREF="../../../../index.html?org/bouncycastle/util/encoders/Base64.html" target="_top"><B>FRAMES</B></A> &nbsp;
  313. &nbsp;<A HREF="Base64.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  314. &nbsp;<SCRIPT type="text/javascript">
  315. <!--
  316. if(window==top) {
  317. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  318. }
  319. //-->
  320. </SCRIPT>
  321. <NOSCRIPT>
  322. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  323. </NOSCRIPT>
  324. </FONT></TD>
  325. </TR>
  326. <TR>
  327. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  328. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  329. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  330. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  331. </TR>
  332. </TABLE>
  333. <A NAME="skip-navbar_bottom"></A>
  334. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  335. <HR>
  336. </BODY>
  337. </HTML>