de.uplanet.util.base64
Class Base64Encoder

java.lang.Object
  extended by de.uplanet.util.base64.Base64Encoder

@Scriptable
public final class Base64Encoder
extends java.lang.Object

Base64 encoding as described in RFC 2045 section 6.8.

0 A17 R34 i51 z
1 B18 S35 j52 0
2 C19 T36 k53 1
3 D20 U37 l54 2
4 E21 V38 m55 3
5 F22 W39 n56 4
6 G23 X40 o57 5
7 H24 Y41 p58 6
8 I25 Z42 q59 7
9 J26 a43 r60 8
10 K27 b44 s61 9
11 L28 c45 t62 +
12 M29 d46 u63 /
13 N30 e47 v
14 O31 f48 w(pad) =
15 P32 g49 x
16 Q33 h50 y

Version:
$Revision: 55004 $

Method Summary
static byte[] decode(char[] p_achSrc)
          Decode a Base64-encoded byte array.
static byte[] decode(char[] p_achSrc, int p_iSrcLen)
          Decode a Base64-encoded byte array.
static char[] encode(byte[] p_aby)
          Base64-encode a byte array.
static char[] encode(byte[] p_aby, int p_iOffset, int p_iLength)
          Base64-encode a byte array with a specified offset and length.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static char[] encode(byte[] p_aby)
Base64-encode a byte array.

Parameters:
p_aby - Array to encode.
Returns:
Encoded data as a character array.

encode

public static char[] encode(byte[] p_aby,
                            int p_iOffset,
                            int p_iLength)
Base64-encode a byte array with a specified offset and length.

Parameters:
p_aby - Array to encode.
p_iOffset - Offset where encoding begins.
p_iLength - Length to encode.
Returns:
Encoded data as a character array or null if p_aby is null or if p_iLength is 0.

decode

public static byte[] decode(char[] p_achSrc)
Decode a Base64-encoded byte array.

Parameters:
p_achSrc - Encoded byte array.
Returns:
Decoded byte array or null if p_achSrc is null or has zero length.

decode

public static byte[] decode(char[] p_achSrc,
                            int p_iSrcLen)
Decode a Base64-encoded byte array.

Parameters:
p_achSrc - Encoded byte array.
p_iSrcLen - Length of the given byte array.
Returns:
Decoded byte array or null if p_achSrc is null or has zero length.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.