com.pega.pegarules.pub.util
Class Base64Util

java.lang.Object
  extended by com.pega.pegarules.pub.util.Base64Util

public class Base64Util
extends java.lang.Object

PegaRULES Base64Util for mime base64 encode/decode support.

Implements encode and decode according to JavaMail/Mime base64 encoding conventions.

Logic based on the classes

and repackaged into static functions to mimic JavaMail 1.1 MIME specification

Version:
$Revision: 29259 $ $Date: 2012-06-12 02:33:57 -0400 (Tue, 12 Jun 2012) $
Author:
Kenneth Olson

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
Base64Util()
           
 
Method Summary
static java.io.OutputStream createEncodingOutputStream(java.io.OutputStream os)
           
static java.io.OutputStream createEncodingOutputStream(java.io.OutputStream os, boolean aIncludeLineBreaks)
           
static byte[] decode(byte[] aInByteArray)
           
static java.io.InputStream decode(java.io.InputStream is)
           
static java.lang.String decode(java.lang.String s)
           
static java.lang.String decode(java.lang.String s, byte[] aBuffer)
           
static byte[] decodeToByteArray(java.lang.String s)
           
static byte[] encode(byte[] aInByteArray)
           
static java.io.OutputStream encode(java.io.OutputStream os)
          Deprecated. This form has a flaw where calls to flush() generate the stream termination sequence, instead of at close. Use createEncodingOutputStream(java.io.OutputStream) instead.
static java.io.OutputStream encode(java.io.OutputStream os, boolean aIncludeLineBreaks)
          Deprecated. This form has a flaw where calls to flush() generate the stream termination sequence, instead of at close. Use createEncodingOutputStream(java.io.OutputStream) instead.
static java.lang.String encode(java.lang.String s)
           
static java.lang.String encode(java.lang.String s, boolean aIncludeLineBreaks)
           
static byte[] encodeToByteArray(java.lang.String s)
           
static java.lang.String encodeToString(byte[] aInByteArray)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Constructor Detail

Base64Util

public Base64Util()
Method Detail

decode

public static java.lang.String decode(java.lang.String s)

decode

public static java.lang.String decode(java.lang.String s,
                                      byte[] aBuffer)

decode

public static byte[] decode(byte[] aInByteArray)

decodeToByteArray

public static byte[] decodeToByteArray(java.lang.String s)

decode

public static java.io.InputStream decode(java.io.InputStream is)

encode

public static byte[] encode(byte[] aInByteArray)

encodeToString

public static java.lang.String encodeToString(byte[] aInByteArray)

encode

public static java.lang.String encode(java.lang.String s)

encode

public static java.lang.String encode(java.lang.String s,
                                      boolean aIncludeLineBreaks)

encodeToByteArray

public static byte[] encodeToByteArray(java.lang.String s)

encode

public static java.io.OutputStream encode(java.io.OutputStream os)
Deprecated. This form has a flaw where calls to flush() generate the stream termination sequence, instead of at close. Use createEncodingOutputStream(java.io.OutputStream) instead.

Parameters:
os - The OutputStream to target with content
Returns:
An OutputStream which encodings the input as it writes

encode

public static java.io.OutputStream encode(java.io.OutputStream os,
                                          boolean aIncludeLineBreaks)
Deprecated. This form has a flaw where calls to flush() generate the stream termination sequence, instead of at close. Use createEncodingOutputStream(java.io.OutputStream) instead.

Parameters:
os - The OutputStream to target with content
aIncludeLineBreaks - Include line breaks?
Returns:
An OutputStream which encodings the input as it writes

createEncodingOutputStream

public static java.io.OutputStream createEncodingOutputStream(java.io.OutputStream os)
Parameters:
os - The OutputStream to target with content
Returns:
An OutputStream which encodings the input as it writes

createEncodingOutputStream

public static java.io.OutputStream createEncodingOutputStream(java.io.OutputStream os,
                                                              boolean aIncludeLineBreaks)
Parameters:
os - The OutputStream to target with content
aIncludeLineBreaks - Include line breaks?
Returns:
An OutputStream which encodings the input as it writes


Copyright © 2012 Pegasystems Inc. All Rights Reserved.