Constructor and Description |
---|
Base64Utils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(char[] data,
int off,
int len) |
static void |
decode(char[] data,
int off,
int len,
OutputStream ostream) |
static byte[] |
decode(String data) |
static void |
decode(String data,
OutputStream ostream) |
static String |
encode(byte[] data)
Returns base64 representation of specified byte array.
|
static String |
encode(byte[] data,
int off,
int len)
Returns base64 representation of specified byte array.
|
static void |
encode(byte[] data,
int off,
int len,
OutputStream ostream)
Outputs base64 representation of the specified byte array to a byte stream.
|
static void |
encode(byte[] data,
int off,
int len,
StringBuffer buffer)
Outputs base64 representation of the specified byte array to the specified String Buffer
|
static void |
encode(byte[] data,
int off,
int len,
Writer writer)
Outputs base64 representation of the specified byte array to a character stream.
|
static String |
encode(DataHandler dh)
Get a base64 representation of the content of a given
DataHandler as a string. |
static char[] |
encodeToCharArray(DataHandler dh)
Get a base64 representation of the content of a given
DataHandler as a char array. |
static boolean |
isValidBase64Encoding(String data)
checks input string for invalid Base64 characters
|
public static String encode(DataHandler dh) throws IOException
DataHandler
as a string.
This method will try to carry out the encoding operation in the most efficient way.dh
- the data handler with the content to encodeIOException
- if an I/O error occurs when reading the content of the data handlerpublic static char[] encodeToCharArray(DataHandler dh) throws IOException
DataHandler
as a char array.
This method will try to carry out the encoding operation in the most efficient way.dh
- the data handler with the content to encodeIOException
- if an I/O error occurs when reading the content of the data handlerpublic static byte[] decode(char[] data, int off, int len)
public static byte[] decode(String data)
public static boolean isValidBase64Encoding(String data)
data
- public static void decode(char[] data, int off, int len, OutputStream ostream) throws IOException
IOException
public static void decode(String data, OutputStream ostream) throws IOException
IOException
public static String encode(byte[] data)
public static String encode(byte[] data, int off, int len)
public static void encode(byte[] data, int off, int len, StringBuffer buffer)
public static void encode(byte[] data, int off, int len, OutputStream ostream) throws IOException
IOException
public static void encode(byte[] data, int off, int len, Writer writer) throws IOException
IOException
Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.