railo.runtime.coder
Class Base64Coder

java.lang.Object
  extended by railo.runtime.coder.Base64Coder

public final class Base64Coder
extends Object

Util class to handle Base 64 Encoded Strings


Constructor Summary
Base64Coder()
           
 
Method Summary
static byte[] decode(String encoded)
          decodes a Base64 String to a Plain String
static String decodeToString(String encoded, String charset)
          decodes a Base64 String to a Plain String
static String encode(byte[] barr)
          encodes a byte array to Base64 String
static String encodeFromString(String plain, String charset)
          encodes a String to Base64 String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64Coder

public Base64Coder()
Method Detail

decodeToString

public static String decodeToString(String encoded,
                                    String charset)
                             throws CoderException,
                                    UnsupportedEncodingException
decodes a Base64 String to a Plain String

Parameters:
encoded -
Returns:
Throws:
ExpressionException
CoderException
UnsupportedEncodingException

encodeFromString

public static String encodeFromString(String plain,
                                      String charset)
                               throws CoderException,
                                      UnsupportedEncodingException
encodes a String to Base64 String

Parameters:
plain - String to encode
Returns:
encoded String
Throws:
CoderException
UnsupportedEncodingException

encode

public static String encode(byte[] barr)
                     throws CoderException
encodes a byte array to Base64 String

Parameters:
barr - byte array to encode
Returns:
encoded String
Throws:
CoderException

decode

public static byte[] decode(String encoded)
                     throws CoderException
decodes a Base64 String to a Plain String

Parameters:
encoded -
Returns:
decoded binary data
Throws:
CoderException


Copyright © 2012 Railo