public class Base64 extends Object
encode
and decode
methods to implement modified base64 schemes.
Decoding assumes correct input, the caller is responsible for ensuring that the input
contains no invalid characters.Constructor and Description |
---|
Base64() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(char[] chars)
Decode base64 chars to bytes.
|
static byte[] |
decode(char[] src,
int[] table,
char pad)
Decode base64 chars to bytes using the supplied decode table and padding
character.
|
static char[] |
encode(byte[] bytes)
Encode bytes to base64 chars, with padding.
|
static char[] |
encode(byte[] bytes,
boolean padded)
Encode bytes to base64 chars, with optional padding.
|
static char[] |
encode(byte[] src,
char[] table,
char pad)
Encode bytes to base64 chars using the supplied encode table and with
optional padding.
|
public static byte[] decode(char[] chars)
chars
- Chars to encode.public static char[] encode(byte[] bytes)
bytes
- Bytes to encode.public static char[] encode(byte[] bytes, boolean padded)
bytes
- Bytes to encode.padded
- Add padding to output.public static byte[] decode(char[] src, int[] table, char pad)
src
- Base64 encoded data.table
- Decode table.pad
- Padding character.public static char[] encode(byte[] src, char[] table, char pad)
src
- Bytes to encode.table
- Encoding table.pad
- Padding character, or 0 for no padding.Copyright © 2019. All rights reserved.