br.gov.ans.tiss.nucleo
Class Base64Encoder

java.lang.Object
  extended by br.gov.ans.tiss.nucleo.Base64Encoder

public class Base64Encoder
extends java.lang.Object

Codificador/ decodificador base 64 obtida de sites de software livre na INTERNET.


Field Summary
private static char[] map1
          Mapa auxiliar para base 64.
private static byte[] map2
          Mapa auxiliar para base 64.
 
Constructor Summary
Base64Encoder()
           
 
Method Summary
static byte[] decode(char[] in)
          Decodes Base64 data.
static java.lang.String decode(java.lang.String s)
          Decodes a Base64 string.
static char[] encode(byte[] in)
          Encodes a byte array into Base64 format.
static java.lang.String encode(java.lang.String s)
          Encodes a string into Base64 format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map1

private static char[] map1
Mapa auxiliar para base 64.


map2

private static byte[] map2
Mapa auxiliar para base 64.

Constructor Detail

Base64Encoder

public Base64Encoder()
Method Detail

encode

public static java.lang.String encode(java.lang.String s)
Encodes a string into Base64 format. No blanks or line breaks are inserted.

Parameters:
s - a String to be encoded.
Returns:
A String with the Base64 encoded data.

encode

public static char[] encode(byte[] in)
Encodes a byte array into Base64 format. No blanks or line breaks are inserted.

Parameters:
in - an array containing the data bytes to be encoded.
Returns:
A character array with the Base64 encoded data.

decode

public static java.lang.String decode(java.lang.String s)
Decodes a Base64 string.

Parameters:
s - a Base64 String to be decoded.
Returns:
A String containing the decoded data.

decode

public static byte[] decode(char[] in)
Decodes Base64 data. No blanks or line breaks are allowed within the Base64 encoded data.

Parameters:
in - a character array containing the Base64 encoded data.
Returns:
An array containing the decoded data bytes.