org.codehaus.cargo.util
Class Base64

java.lang.Object
  extended by org.codehaus.cargo.util.Base64

public final class Base64
extends Object

Provides utility methods to Base64 encode data. This class uses the Base64 encoding as specified in RFC 2045, 6.8. Base64 Content-Transfer-Encoding.

Version:
$Id: Base64.java 1705 2008-09-02 13:14:55Z adriana $

Method Summary
static byte[] encode(byte[] bytes)
          Base64 encodes the specified bytes.
static String encode(String string)
          Base64 encodes the specified string using the platform's default encoding.
static byte[] encodeBase64(byte[] bytes)
          Base64 encodes the specified bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encodeBase64

public static byte[] encodeBase64(byte[] bytes)
Base64 encodes the specified bytes. This method is provided for signature compatibility with commons-codec.

Parameters:
bytes - the bytes to encode
Returns:
the encoded bytes

encode

public static String encode(String string)
Base64 encodes the specified string using the platform's default encoding.

Parameters:
string - the string to encode
Returns:
the encoded string

encode

public static byte[] encode(byte[] bytes)
Base64 encodes the specified bytes.

Parameters:
bytes - the bytes to encode
Returns:
the encoded bytes


Copyright © 2004-2012 Codehaus. All Rights Reserved.