public final class Base64 extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(String data)
Decodes a given Base64 string into its corresponding byte array.
|
static Byte[] |
decodeAsByteObjectArray(String data)
Decodes a given Base64 string into its corresponding byte array.
|
static String |
encode(byte[] data)
Encodes a byte array as a Base64 string.
|
static String |
encode(Byte[] data)
Encodes a byte array as a Base64 string.
|
static boolean |
validateIsBase64String(String data)
Determines whether the given string contains only Base64 characters.
|
public static byte[] decode(String data)
data - the Base64 string, as a String object, to decodeIllegalArgumentException - If the string is not a valid base64 encoded stringpublic static Byte[] decodeAsByteObjectArray(String data)
data - the Base64 string, as a String object, to decodeIllegalArgumentException - If the string is not a valid base64 encoded stringpublic static String encode(byte[] data)
data - the byte array to encodeString objectpublic static String encode(Byte[] data)
data - the byte array to encodeString objectpublic static boolean validateIsBase64String(String data)
data - the string, as a String object, to validatetrue if data is a valid Base64 string, otherwise false/**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/