File: mxBase64.html

package info (click to toggle)
libjgraphx-java 2.1.0.7-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,776 kB
  • sloc: java: 57,366; xml: 509; javascript: 101; sh: 13; makefile: 6
file content (531 lines) | stat: -rw-r--r-- 27,290 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
<!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_43) on Wed Jul 31 13:58:28 CEST 2013 -->
<TITLE>
mxBase64 (JGraph X 2.1.0.7 API Specification)
</TITLE>

<META NAME="date" CONTENT="2013-07-31">

<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="mxBase64 (JGraph X 2.1.0.7 API Specification)";
    }
}
</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/mxBase64.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>
<p><b>JGraph X 2.1.0.7</b></p></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../com/mxgraph/util/mxCellRenderer.html" title="class in com.mxgraph.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/mxgraph/util/mxBase64.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="mxBase64.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;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&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">
com.mxgraph.util</FONT>
<BR>
Class mxBase64</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.mxgraph.util.mxBase64</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>mxBase64</B><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
A very fast and memory efficient class to encode and decode to and from BASE64 in full accordance
 with RFC 2045.<br><br>
 On Windows XP sp1 with 1.4.2_04 and later ;), this encoder and decoder is about 10 times faster
 on small arrays (10 - 1000 bytes) and 2-3 times as fast on larger arrays (10000 - 1000000 bytes)
 compared to <code>sun.misc.Encoder()/Decoder()</code>.<br><br>

 On byte arrays the encoder is about 20% faster than Jakarta Commons Base64 Codec for encode and
 about 50% faster for decoding large arrays. This implementation is about twice as fast on very small
 arrays (&lt 30 bytes). If source/destination is a <code>String</code> this
 version is about three times as fast due to the fact that the Commons Codec result has to be recoded
 to a <code>String</code> from <code>byte[]</code>, which is very expensive.<br><br>

 This encode/decode algorithm doesn't create any temporary arrays as many other codecs do, it only
 allocates the resulting array. This produces less garbage and it is possible to handle arrays twice
 as large as algorithms that create a temporary array. (E.g. Jakarta Commons Codec). It is unknown
 whether Sun's <code>sun.misc.Encoder()/Decoder()</code> produce temporary arrays but since performance
 is quite low it probably does.<br><br>

 The encoder produces the same output as the Sun one except that the Sun's encoder appends
 a trailing line separator if the last character isn't a pad. Unclear why but it only adds to the
 length and is probably a side effect. Both are in conformance with RFC 2045 though.<br>
 Commons codec seem to always att a trailing line separator.<br><br>

 <b>Note!</b>
 The encode/decode method pairs (types) come in three versions with the <b>exact</b> same algorithm and
 thus a lot of code redundancy. This is to not create any temporary arrays for transcoding to/from different
 format types. The methods not used can simply be commented out.<br><br>

 There is also a "fast" version of all decode methods that works the same way as the normal ones, but
 har a few demands on the decoded input. Normally though, these fast verions should be used if the source if
 the input is known and it hasn't bee tampered with.<br><br>

 If you find the code useful or you find a bug, please send me a note at base64 @ miginfocom . com.

 Licence (BSD):
 ==============

 Copyright (c) 2004, Mikael Grev, MiG InfoCom AB. (base64 @ miginfocom . com)
 All rights reserved.

 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 Redistributions of source code must retain the above copyright notice, this list
 of conditions and the following disclaimer.
 Redistributions in binary form must reproduce the above copyright notice, this
 list of conditions and the following disclaimer in the documentation and/or other
 materials provided with the distribution.
 Neither the name of the MiG InfoCom AB nor the names of its contributors may be
 used to endorse or promote products derived from this software without specific
 prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 OF SUCH DAMAGE.
<P>

<P>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_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>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/mxgraph/util/mxBase64.html#mxBase64()">mxBase64</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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="../../../com/mxgraph/util/mxBase64.html#decode(byte[])">decode</A></B>(byte[]&nbsp;sArr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes a BASE64 encoded 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="../../../com/mxgraph/util/mxBase64.html#decode(char[])">decode</A></B>(char[]&nbsp;sArr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes a BASE64 encoded char 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="../../../com/mxgraph/util/mxBase64.html#decode(java.lang.String)">decode</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes a BASE64 encoded <code>String</code>.</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="../../../com/mxgraph/util/mxBase64.html#decodeFast(byte[])">decodeFast</A></B>(byte[]&nbsp;sArr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes a BASE64 encoded byte array that is known to be resonably well formatted.</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="../../../com/mxgraph/util/mxBase64.html#decodeFast(char[])">decodeFast</A></B>(char[]&nbsp;sArr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes a BASE64 encoded char array that is known to be resonably well formatted.</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="../../../com/mxgraph/util/mxBase64.html#decodeFast(java.lang.String)">decodeFast</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes a BASE64 encoded string that is known to be resonably well formatted.</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="../../../com/mxgraph/util/mxBase64.html#encodeToByte(byte[], boolean)">encodeToByte</A></B>(byte[]&nbsp;sArr,
             boolean&nbsp;lineSep)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a raw byte array into a BASE64 <code>byte[]</code> representation i accordance with RFC 2045.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;char[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mxgraph/util/mxBase64.html#encodeToChar(byte[], boolean)">encodeToChar</A></B>(byte[]&nbsp;sArr,
             boolean&nbsp;lineSep)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a raw byte array into a BASE64 <code>char[]</code> representation i accordance with RFC 2045.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mxgraph/util/mxBase64.html#encodeToString(byte[], boolean)">encodeToString</A></B>(byte[]&nbsp;sArr,
               boolean&nbsp;lineSep)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encodes a raw byte array into a BASE64 <code>String</code> representation i accordance with RFC 2045.</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://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/1.5.0/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://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_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>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="mxBase64()"><!-- --></A><H3>
mxBase64</H3>
<PRE>
public <B>mxBase64</B>()</PRE>
<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="encodeToChar(byte[], boolean)"><!-- --></A><H3>
encodeToChar</H3>
<PRE>
public static final char[] <B>encodeToChar</B>(byte[]&nbsp;sArr,
                                        boolean&nbsp;lineSep)</PRE>
<DL>
<DD>Encodes a raw byte array into a BASE64 <code>char[]</code> representation i accordance with RFC 2045.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The bytes to convert. If <code>null</code> or length 0 an empty array will be returned.<DD><CODE>lineSep</CODE> - Optional "\r\n" after 76 characters, unless end of file.<br>
 No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a
 little faster.
<DT><B>Returns:</B><DD>A BASE64 encoded array. Never <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="decode(char[])"><!-- --></A><H3>
decode</H3>
<PRE>
public static final byte[] <B>decode</B>(char[]&nbsp;sArr)</PRE>
<DL>
<DD>Decodes a BASE64 encoded char array. All illegal characters will be ignored and can handle both arrays with
 and without line separators.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The source array. <code>null</code> or length 0 will return an empty array.
<DT><B>Returns:</B><DD>The decoded array of bytes. May be of length 0. Will be <code>null</code> if the legal characters
 (including '=') isn't divideable by 4.  (I.e. definitely corrupted).</DL>
</DD>
</DL>
<HR>

<A NAME="decodeFast(char[])"><!-- --></A><H3>
decodeFast</H3>
<PRE>
public static final byte[] <B>decodeFast</B>(char[]&nbsp;sArr)</PRE>
<DL>
<DD>Decodes a BASE64 encoded char array that is known to be resonably well formatted. The method is about twice as
 fast as <A HREF="../../../com/mxgraph/util/mxBase64.html#decode(char[])"><CODE>decode(char[])</CODE></A>. The preconditions are:<br>
 + The array must have a line length of 76 chars OR no line separators at all (one line).<br>
 + Line separator must be "\r\n", as specified in RFC 2045
 + The array must not contain illegal characters within the encoded string<br>
 + The array CAN have illegal characters at the beginning and end, those will be dealt with appropriately.<br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The source array. Length 0 will return an empty array. <code>null</code> will throw an exception.
<DT><B>Returns:</B><DD>The decoded array of bytes. May be of length 0.</DL>
</DD>
</DL>
<HR>

<A NAME="encodeToByte(byte[], boolean)"><!-- --></A><H3>
encodeToByte</H3>
<PRE>
public static final byte[] <B>encodeToByte</B>(byte[]&nbsp;sArr,
                                        boolean&nbsp;lineSep)</PRE>
<DL>
<DD>Encodes a raw byte array into a BASE64 <code>byte[]</code> representation i accordance with RFC 2045.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The bytes to convert. If <code>null</code> or length 0 an empty array will be returned.<DD><CODE>lineSep</CODE> - Optional "\r\n" after 76 characters, unless end of file.<br>
 No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a
 little faster.
<DT><B>Returns:</B><DD>A BASE64 encoded array. Never <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="decode(byte[])"><!-- --></A><H3>
decode</H3>
<PRE>
public static final byte[] <B>decode</B>(byte[]&nbsp;sArr)</PRE>
<DL>
<DD>Decodes a BASE64 encoded byte array. All illegal characters will be ignored and can handle both arrays with
 and without line separators.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The source array. Length 0 will return an empty array. <code>null</code> will throw an exception.
<DT><B>Returns:</B><DD>The decoded array of bytes. May be of length 0. Will be <code>null</code> if the legal characters
 (including '=') isn't divideable by 4. (I.e. definitely corrupted).</DL>
</DD>
</DL>
<HR>

<A NAME="decodeFast(byte[])"><!-- --></A><H3>
decodeFast</H3>
<PRE>
public static final byte[] <B>decodeFast</B>(byte[]&nbsp;sArr)</PRE>
<DL>
<DD>Decodes a BASE64 encoded byte array that is known to be resonably well formatted. The method is about twice as
 fast as <A HREF="../../../com/mxgraph/util/mxBase64.html#decode(byte[])"><CODE>decode(byte[])</CODE></A>. The preconditions are:<br>
 + The array must have a line length of 76 chars OR no line separators at all (one line).<br>
 + Line separator must be "\r\n", as specified in RFC 2045
 + The array must not contain illegal characters within the encoded string<br>
 + The array CAN have illegal characters at the beginning and end, those will be dealt with appropriately.<br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The source array. Length 0 will return an empty array. <code>null</code> will throw an exception.
<DT><B>Returns:</B><DD>The decoded array of bytes. May be of length 0.</DL>
</DD>
</DL>
<HR>

<A NAME="encodeToString(byte[], boolean)"><!-- --></A><H3>
encodeToString</H3>
<PRE>
public static final <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>encodeToString</B>(byte[]&nbsp;sArr,
                                          boolean&nbsp;lineSep)</PRE>
<DL>
<DD>Encodes a raw byte array into a BASE64 <code>String</code> representation i accordance with RFC 2045.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sArr</CODE> - The bytes to convert. If <code>null</code> or length 0 an empty array will be returned.<DD><CODE>lineSep</CODE> - Optional "\r\n" after 76 characters, unless end of file.<br>
 No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a
 little faster.
<DT><B>Returns:</B><DD>A BASE64 encoded array. Never <code>null</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="decode(java.lang.String)"><!-- --></A><H3>
decode</H3>
<PRE>
public static final byte[] <B>decode</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</PRE>
<DL>
<DD>Decodes a BASE64 encoded <code>String</code>. All illegal characters will be ignored and can handle both strings with
 and without line separators.<br>
 <b>Note!</b> It can be up to about 2x the speed to call <code>decode(str.toCharArray())</code> instead. That
 will create a temporary array though. This version will use <code>str.charAt(i)</code> to iterate the string.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - The source string. <code>null</code> or length 0 will return an empty array.
<DT><B>Returns:</B><DD>The decoded array of bytes. May be of length 0. Will be <code>null</code> if the legal characters
 (including '=') isn't divideable by 4.  (I.e. definitely corrupted).</DL>
</DD>
</DL>
<HR>

<A NAME="decodeFast(java.lang.String)"><!-- --></A><H3>
decodeFast</H3>
<PRE>
public static final byte[] <B>decodeFast</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;s)</PRE>
<DL>
<DD>Decodes a BASE64 encoded string that is known to be resonably well formatted. The method is about twice as
 fast as <A HREF="../../../com/mxgraph/util/mxBase64.html#decode(java.lang.String)"><CODE>decode(String)</CODE></A>. The preconditions are:<br>
 + The array must have a line length of 76 chars OR no line separators at all (one line).<br>
 + Line separator must be "\r\n", as specified in RFC 2045
 + The array must not contain illegal characters within the encoded string<br>
 + The array CAN have illegal characters at the beginning and end, those will be dealt with appropriately.<br>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - The source string. Length 0 will return an empty array. <code>null</code> will throw an exception.
<DT><B>Returns:</B><DD>The decoded array of bytes. May be of length 0.</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/mxBase64.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>
<p><b>JGraph X 2.1.0.7</b></p></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../com/mxgraph/util/mxCellRenderer.html" title="class in com.mxgraph.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/mxgraph/util/mxBase64.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="mxBase64.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;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size=1>Copyright (c) 2010 <a href="http://www.mxgraph.com/"
				target="_blank">Gaudenz Alder</a>. All rights reserved.</font>
</BODY>
</HTML>