org.apache.vinci.transport.util
Class Base64Converter

java.lang.Object
  extended by org.apache.vinci.transport.util.Base64Converter

public class Base64Converter
extends java.lang.Object

Provides utility methods for Binary <=> Base64 conversion.


Field Summary
static int LINE_LENGTH
          If you ask for line-breaks, this is the maximum line length used.
 
Method Summary
static int calculateBase64OutputSize(int input_size, boolean line_breaks)
          Calculates the size of the resulting Base64 string returned by this class for a binary byte array of the specified length.
static int calculateBinaryOutputSize(byte[] input, int input_size)
          Calculate the number of bytes encoded by a given Base64 input.
static java.lang.String convertBase64StringToString(java.lang.String base64)
           
static byte[] convertBase64ToBinary(byte[] input)
           
static byte[] convertBase64ToBinary(byte[] input, int input_size)
           
static byte[] convertBinaryToBase64(byte[] from)
           
static byte[] convertBinaryToBase64(byte[] from, int count, boolean line_breaks)
           
static java.lang.String convertStringToBase64String(java.lang.String convert_me)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_LENGTH

public static final int LINE_LENGTH
If you ask for line-breaks, this is the maximum line length used.

See Also:
Constant Field Values
Method Detail

convertBinaryToBase64

public static byte[] convertBinaryToBase64(byte[] from)

convertStringToBase64String

public static java.lang.String convertStringToBase64String(java.lang.String convert_me)

convertBase64StringToString

public static java.lang.String convertBase64StringToString(java.lang.String base64)
                                                    throws Base64FormatException
Throws:
Base64FormatException

convertBinaryToBase64

public static byte[] convertBinaryToBase64(byte[] from,
                                           int count,
                                           boolean line_breaks)

calculateBase64OutputSize

public static int calculateBase64OutputSize(int input_size,
                                            boolean line_breaks)
Calculates the size of the resulting Base64 string returned by this class for a binary byte array of the specified length. Includes carriage returns and all.


convertBase64ToBinary

public static byte[] convertBase64ToBinary(byte[] input)
                                    throws Base64FormatException
Throws:
Base64FormatException

convertBase64ToBinary

public static byte[] convertBase64ToBinary(byte[] input,
                                           int input_size)
                                    throws Base64FormatException
Throws:
Base64FormatException

calculateBinaryOutputSize

public static int calculateBinaryOutputSize(byte[] input,
                                            int input_size)
                                     throws Base64FormatException
Calculate the number of bytes encoded by a given Base64 input.

Throws:
Base64FormatException


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.