ZetaGrid v1.9

zeta.util
Class Base64

java.lang.Object
  |
  +--zeta.util.Base64

public class Base64
extends java.lang.Object

Base64 is a system for representing raw byte data as ASCII characters. RFC 1521 is NOT implemented since the characters '-','.','*' are used instead of '+','/','=' Then the encoded data can be used in URL.


Field Summary
private static byte[] decodeMap
          Decodes a character to an integer less than 64 and returns -1 for a not defined character
private static char[] encodeMap
          Converts an integer less than 64 to a character
private static char ENCODING_62
           
private static char ENCODING_63
           
static char PAD
           
 
Constructor Summary
Base64()
           
 
Method Summary
static byte[] decode(java.lang.String encodedData)
          Decodes Base64 data.
static java.lang.String encode(byte[] data)
          Encodes a string into Base64 format.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAD

public static char PAD

ENCODING_62

private static char ENCODING_62

ENCODING_63

private static char ENCODING_63

decodeMap

private static byte[] decodeMap
Decodes a character to an integer less than 64 and returns -1 for a not defined character


encodeMap

private static char[] encodeMap
Converts an integer less than 64 to a character

Constructor Detail

Base64

public Base64()
Method Detail

encode

public static java.lang.String encode(byte[] data)
Encodes a string into Base64 format. No blanks or line breaks are inserted. RFC 1521 is NOT implemented since the output string is repesented in one line and not in lines of more than 76 characters each.

Parameters:
data - a raw byte data to be encoded.
Returns:
a string with the Base64 encoded data.

decode

public static byte[] decode(java.lang.String encodedData)
Decodes Base64 data. All line breaks or other characters not found in the encoding table will be ignored.

Parameters:
encodedData - string containing the Base64 encoded data with a length equal to 0 mod 4.
Returns:
raw byte data containing the decoded data.
Throws:
java.lang.IllegalArgumentException - if the input is not valid Base64 encoded data.

main

public static void main(java.lang.String[] args)

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.