com.plumtree.openfoundation.util
Class XPBase64Coder

java.lang.Object
  extended bycom.plumtree.openfoundation.util.XPBase64Coder

public class XPBase64Coder
extends java.lang.Object

Encodes and decodes to and from Base64 notation.

Change Log:

I am placing this code in the Public Domain. Do with it as you will. This software comes with no guarantees or warranties but with plenty of well-wishing instead! Please visit http://iharder.net/xmlizable periodically to check for updates or to contribute improvements.


Method Summary
static byte[] Decode(java.lang.String s)
          Decodes data from Base64 notation.
static java.lang.String DecodeToString(java.lang.String s)
          Decodes data from Base64 notation and returns it as a string.
static java.lang.String Encode(byte[] source)
          Encodes a byte array into Base64 notation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

Encode

public static java.lang.String Encode(byte[] source)
Encodes a byte array into Base64 notation. Equivalent to calling encodeBytes( source, 0, source.length )

Parameters:
source - The data to convert
Returns:
Encoded Text.

Decode

public static byte[] Decode(java.lang.String s)
Decodes data from Base64 notation.

Parameters:
s - the string to decode
Returns:
the decoded data
Since:
1.4

DecodeToString

public static java.lang.String DecodeToString(java.lang.String s)
Decodes data from Base64 notation and returns it as a string. Equivlaent to calling new String( Decode( s ) )

Parameters:
s - the strind to decode
Returns:
The data as a string
Since:
1.4


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.