org.tentackle.util
Class Base64

java.lang.Object
  extended by org.tentackle.util.Base64

public class Base64
extends Object

Yet another Base64 implementation...
(because Sun does not provide an "official" one)
Does not support line-breaking. This needs to be done by the application.

Author:
harald

Constructor Summary
Base64()
           
 
Method Summary
static byte[] base64ToByteArray(char[] src)
          Decodes base64.
static byte[] base64ToByteArray(String src)
          Decodes base64.
static String byteArrayToBase64(byte[] src)
          Encodes to base64.
static char[] byteArrayToBase64Array(byte[] src)
          Encodes to base64.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64

public Base64()
Method Detail

base64ToByteArray

public static byte[] base64ToByteArray(char[] src)
Decodes base64.

Parameters:
src - the source character array in base64
Returns:
the decoded byte array or null if src is null
Throws:
IllegalArgumentException - if src is not well-formatted

base64ToByteArray

public static byte[] base64ToByteArray(String src)
Decodes base64.

Parameters:
src - the source String in base64
Returns:
the decoded byte array or null if src is null

byteArrayToBase64Array

public static char[] byteArrayToBase64Array(byte[] src)
Encodes to base64.

Parameters:
src - the byte array
Returns:
the character array in base64 encoding or null if src is null

byteArrayToBase64

public static String byteArrayToBase64(byte[] src)
Encodes to base64.

Parameters:
src - the byte array
Returns:
the String in base64 encoding or null if src is null


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de