com.sun.syndication.io.impl
Class Base64

java.lang.Object
  extended bycom.sun.syndication.io.impl.Base64

public class Base64
extends java.lang.Object

Encodes/decodes String values into/from a base 64 String.

It uses Jakarta commons codec Base64 class.

Author:
Alejandro Abdelnur

Constructor Summary
Base64()
           
 
Method Summary
static java.lang.String decode(java.lang.String s, java.lang.String encoding)
          Decodes a base 64 String into a String.
static java.lang.String encode(java.lang.String s, java.lang.String encoding)
          Encodes a String into a base 64 String.
 
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

encode

public static java.lang.String encode(java.lang.String s,
                                      java.lang.String encoding)
                               throws java.io.UnsupportedEncodingException
Encodes a String into a base 64 String. The resulting encoding is chunked at 76 bytes.

Parameters:
s - String to encode.
encoding - the encoding of the original String, null indicates platform's default.
Returns:
encoded string.
Throws:
java.io.UnsupportedEncodingException - thrown if the given encoding is not supported.

decode

public static java.lang.String decode(java.lang.String s,
                                      java.lang.String encoding)
                               throws java.io.UnsupportedEncodingException
Decodes a base 64 String into a String.

Parameters:
s - String to decode.
encoding - the encoding of the String being decoded, null indicates platform's default.
Returns:
encoded string.
Throws:
java.io.UnsupportedEncodingException - thrown if the given encoding is not supported.


Copyright © 2004 Sun Microsystems. All Rights Reserved.