SAP NetWeaver '04

com.sapportals.wcm.util.http
Class Base64

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.http.Base64

public class Base64
extends java.lang.Object

Yet another base64 implementation.

Copyright (c) SAP AG 2001-2003


Constructor Summary
Base64()
           
 
Method Summary
static byte[] decode(java.lang.String buffer)
          Base64 decode the string in the buffer according to RFC 2045.
static java.lang.String decodeString(java.lang.String buffer)
          Base64 decode the string in the buffer according to RFC 2045.
static java.lang.String encode(byte[] buffer)
          Base64 encode the bytes in buffer according to RFC 2045.
static java.lang.String encode(byte[] buffer, int linelen)
          Base64 encode the bytes in buffer.
static java.lang.String encode(java.lang.String buffer)
          Base64 encode the string in buffer according to RFC 2045.
static java.lang.String encode(java.lang.String buffer, java.lang.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 java.lang.String encode(java.lang.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 java.lang.String encode(java.lang.String buffer,
                                      java.lang.String encoding)
                               throws java.io.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

encode

public static java.lang.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 java.lang.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(java.lang.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 java.lang.String decodeString(java.lang.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

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.