public class Base64Tool
extends java.lang.Object
Base 64 toolbox
Constructor and Description |
---|
Base64Tool() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
byteArrayToAltBase64(byte[] a)
Translates the specified byte array into an "aternate representation"
Base64 string.
|
static java.lang.String |
byteArrayToBase64(byte[] a)
Translates the specified byte array into a Base64 string as per
Preferences.put(byte[]).
|
static byte[] |
decode(char[] in)
Decodes a byte array from Base64 format.
|
static byte[] |
decode(java.lang.String s)
Decodes a byte array from Base64 format.
|
static java.lang.String |
decodeString(java.lang.String s)
Decodes a string from Base64 format.
|
static char[] |
encode(byte[] in)
Encodes a byte array into Base64 format.
|
static char[] |
encode(byte[] in,
int iLen)
Encodes a byte array into Base64 format.
|
static java.lang.String |
encodeBytes(byte[] in)
Encodes a byte array into Base64 format.
|
static java.lang.String |
encodeFile(java.lang.String filename)
Encodes a file into a Base64 format string.
|
static java.lang.String |
encodeString(java.lang.String s)
Encodes a string into Base64 format.
|
public static java.lang.String encodeString(java.lang.String s)
s
- A String to be encoded.public static java.lang.String encodeBytes(byte[] in)
in
- An array containing the data bytes to be encoded.public static char[] encode(byte[] in)
in
- An array containing the data bytes to be encoded.public static char[] encode(byte[] in, int iLen)
in
- An array containing the data bytes to be encoded.iLen
- Number of bytes to process in in
.public static java.lang.String decodeString(java.lang.String s)
s
- A Base64 String to be decoded.java.lang.IllegalArgumentException
- if the input is not valid Base64 encoded data.public static byte[] decode(java.lang.String s)
s
- A Base64 String to be decoded.java.lang.IllegalArgumentException
- if the input is not valid Base64 encoded data.public static byte[] decode(char[] in)
in
- A character array containing the Base64 encoded data.java.lang.IllegalArgumentException
- if the input is not valid Base64 encoded data.public static java.lang.String encodeFile(java.lang.String filename) throws java.lang.Exception
Encodes a file into a Base64 format string.
java.lang.Exception
public static java.lang.String byteArrayToBase64(byte[] a)
public static java.lang.String byteArrayToAltBase64(byte[] a)
Copyright (c)2006-2014 Simplicite Software. All Rights Reserved.