public final class Base64 extends Object
Modifier and Type | Field and Description |
---|---|
static Base64 |
DEFAULT |
static Base64 |
DEFAULT_UNPADDED |
static Base64 |
URLSAFE |
static Base64 |
URLSAFE_UNPADDED |
Constructor and Description |
---|
Base64(String alphabet)
Creates Base64 coder with a given alphabet.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decode(String source)
Decodes source string.
|
String |
encode(byte[] source)
Encodes source bytes.
|
String |
getAlphabet()
Returns Bas64 alphabet that is used by this coder.
|
String |
toString()
Returns a string representation of the object.
|
public static final Base64 DEFAULT
public static final Base64 URLSAFE
public static final Base64 DEFAULT_UNPADDED
public static final Base64 URLSAFE_UNPADDED
public Base64(String alphabet)
alphabet
- an alphabet of 64 characters.public String getAlphabet()
public String encode(byte[] source)
source
- source bytes.public byte[] decode(String source)
source
- source string.InvalidFormatException
- if the string do not have the correct Base64 format.Copyright © 2002–2025 Devexperts LLC. All rights reserved.