Expresso 5-6

com.jcorporate.expresso.core.misc
Class CookieBase64

java.lang.Object
  extended bycom.jcorporate.expresso.core.misc.CookieBase64

public class CookieBase64
extends Object

Proprietary Base64-like encoding class that makes sure there are no special characters that are "illegal" to cookies.

Author:
Michael Rimov

Constructor Summary
CookieBase64()
           
 
Method Summary
static byte[] decodeNoPadding(String data)
          Note: this function does not process stricly compliant Base64 code.
static String encodeNoPadding(byte[] inBuffer)
          Note: this function does not process stricly compliant Base64 code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieBase64

public CookieBase64()
Method Detail

decodeNoPadding

public static byte[] decodeNoPadding(String data)
                              throws IllegalArgumentException
Note: this function does not process stricly compliant Base64 code. To process strictly compliant Base64 encoded strings, use encode and decode functions with padding

Decodes a Base64 encoded string back into its original binary format. The only difference from decode is that this function will bad the end with as many ='s as necessary to make things work properly.

Parameters:
data - the Base64 encoded string
Returns:
the byte array of the original data.
Throws:
IllegalArgumentException - if the input data is null or zero bytes.

encodeNoPadding

public static String encodeNoPadding(byte[] inBuffer)
                              throws IllegalArgumentException
Note: this function does not process stricly compliant Base64 code. To process strictly compliant Base64 encoded strings, use encode and decode functions with padding

Encodes a binary bite array into Base64 coding. The difference between this and the other encode function, is that this function strips all padding from the final result before returning

Returns:
a string that is the Base64 equiv of the input data without padding characters
Throws:
IllegalArgumentException - if the input data is null or zero bytes.

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.