public class Base64Encoder extends Object
Base64Encoder
is used to encode and decode base64
content. The implementation used here provides a reasonably fast
memory efficient encoder for use with input and output streams. It
is possible to achieve higher performance, however, ease of use
and convenience are the priorities with this implementation. This
can only decode complete blocks.Base64OutputStream
,
Base64InputStream
Constructor and Description |
---|
Base64Encoder() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(char[] text)
This is used to decode the provide base64 data back in to an
array of binary data.
|
static byte[] |
decode(char[] text,
int off,
int len)
This is used to decode the provide base64 data back in to an
array of binary data.
|
static char[] |
encode(byte[] buf)
This method is used to encode the specified byte array of binary
data in to base64 data.
|
static char[] |
encode(byte[] buf,
int off,
int len)
This method is used to encode the specified byte array of binary
data in to base64 data.
|
public static char[] encode(byte[] buf)
buf
- this is the binary data to be encodedpublic static char[] encode(byte[] buf, int off, int len)
buf
- this is the binary data to be encodedoff
- this is the offset to read the binary data fromlen
- this is the length of data to encode from the arraypublic static byte[] decode(char[] text)
text
- this is the base64 text to be decodedpublic static byte[] decode(char[] text, int off, int len)
text
- this is the base64 text to be decodedoff
- this is the offset to read the text data fromlen
- this is the length of data to decode from the textCopyright © 2015. All rights reserved.