Spring for Android

org.springframework.util
Class Base64Utils

java.lang.Object
  extended by org.springframework.util.Base64Utils

public abstract class Base64Utils
extends java.lang.Object

A simple utility class for Base64 encoding and decoding that delegates to Android's Base64 class.

Since:
1.0
Author:
Juergen Hoeller, Roy Clarkson

Constructor Summary
Base64Utils()
           
 
Method Summary
static byte[] decode(byte[] src)
          Base64-decode the given byte array.
static byte[] decode(java.lang.String src)
          Deprecated. in favor of decodeFromString(String)
static byte[] decodeFromString(java.lang.String src)
          Base64-decode the given byte array from an UTF-8 String.
static byte[] encode(byte[] src)
          Base64-encode the given byte array.
static java.lang.String encodeToString(byte[] src)
          Base64-encode the given byte array to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64Utils

public Base64Utils()
Method Detail

encode

public static byte[] encode(byte[] src)
Base64-encode the given byte array.

Parameters:
src - the original byte array (may be null)
Returns:
the encoded byte array (or null if the input was null)

encodeToString

public static java.lang.String encodeToString(byte[] src)
Base64-encode the given byte array to a String.

Parameters:
src - the original byte array (may be null)
Returns:
the encoded byte array as a UTF-8 String (or null if the input was null)

decode

public static byte[] decode(byte[] src)
Base64-decode the given byte array.

Parameters:
src - the encoded byte array (may be null)
Returns:
the original byte array (or null if the input was null)

decode

@Deprecated
public static byte[] decode(java.lang.String src)
Deprecated. in favor of decodeFromString(String)

Base64-decode the given byte array from an UTF-8 String.

Parameters:
src - the encoded UTF-8 String (may be null)
Returns:
the original byte array (or null if the input was null)

decodeFromString

public static byte[] decodeFromString(java.lang.String src)
Base64-decode the given byte array from an UTF-8 String.

Parameters:
src - the encoded UTF-8 String (may be null)
Returns:
the original byte array (or null if the input was null)
Since:
2.0

Spring for Android