com.sapportals.wcm.util.http

Class Base64

java.lang.Object
  extended by com.sapportals.wcm.util.http.Base64

public class Base64
extends Object

Yet another base64 implementation.

Copyright (c) SAP AG 2001-2003


Constructor Summary
Base64()
           
 
Method Summary
static byte[] decode(String buffer)
          Base64 decode the string in the buffer according to RFC 2045.
static String decodeString(String buffer)
          Base64 decode the string in the buffer according to RFC 2045.
static String encode(byte[] buffer)
          Base64 encode the bytes in buffer according to RFC 2045.
static String encode(byte[] buffer, int linelen)
          Base64 encode the bytes in buffer.
static String encode(String buffer)
          Base64 encode the string in buffer according to RFC 2045.
static String encode(String buffer, String encoding)
          Base64 encode the string in buffer according to RFC 2045 with specified character encoding.
 
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 String encode(String buffer)
Base64 encode the string in buffer according to RFC 2045. Default character encoding is applied to buffer.

Parameters:
buffer - TBD: Description of the incoming method parameter
Returns:
the encoded bytes

encode

public static String encode(String buffer,
                            String encoding)
                     throws UnsupportedEncodingException
Base64 encode the string in buffer according to RFC 2045 with specified character encoding.

Parameters:
buffer - to encode
encoding - to use
Returns:
the encoded bytes
Throws:
UnsupportedEncodingException

encode

public static String encode(byte[] buffer)
Base64 encode the bytes in buffer according to RFC 2045.

Parameters:
buffer - to encode
Returns:
the encoded bytes

encode

public static String encode(byte[] buffer,
                            int linelen)
Base64 encode the bytes in buffer. Insert cr+lf after linelen characters.

Parameters:
buffer - to encode
linelen - to use
Returns:
the encoded bytes

decode

public static byte[] decode(String buffer)
                     throws WcmException
Base64 decode the string in the buffer according to RFC 2045.

Parameters:
buffer - TBD: Description of the incoming method parameter
Returns:
the original bytes
Throws:
WcmException - Exception raised in failure situation

decodeString

public static String decodeString(String buffer)
                           throws WcmException
Base64 decode the string in the buffer according to RFC 2045. Convenience method when it is known the the orignal consisted of characters. Platform default charset applies!

Parameters:
buffer - TBD: Description of the incoming method parameter
Returns:
the original string
Throws:
WcmException - Exception raised in failure situation
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice