org.jvyamlb.util
Class Base64Coder

java.lang.Object
  extended byorg.jvyamlb.util.Base64Coder

public class Base64Coder
extends java.lang.Object

Author:
Ola Bini

Constructor Summary
Base64Coder()
           
 
Method Summary
static byte[] decode(byte[] in)
          Decodes Base64 data.
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
 

Constructor Detail

Base64Coder

public Base64Coder()
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 byte[] decode(byte[] 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.
Throws:
java.lang.IllegalArgumentException - if the input is not valid Base64 encoded data.


Copyright © 2002-2007 JRuby Team. All Rights Reserved.