public class Base64 extends Object
Constructor and Description |
---|
Base64() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(String encoded)
Converts a Base64 encoded string to a byte array.
|
static byte[] |
decode(String encoded,
int offset,
int length)
Converts an embedded Base64 encoded string to a byte array.
|
static String |
encode(byte[] data)
Converts a byte array into a Base64 encoded string.
|
static String |
encode(byte[] data,
int offset,
int length)
Converts a byte array into a Base64 encoded string.
|
public static String encode(byte[] data)
data
- bytes to encode.public static String encode(byte[] data, int offset, int length)
data
- bytes to encode.offset
- which byte to start at.length
- how many bytes to encode; padding will be added if needed.public static byte[] decode(String encoded) throws IOException
encoded
- Base64 encoded data.IOException
- if an I/O error occurs reading the data.public static byte[] decode(String encoded, int offset, int length) throws IOException
encoded
- a String with Base64 data embedded in it.offset
- which char of the String to start at.length
- how many chars to decode; must be a multiple of 4.IOException
- if an I/O error occurs reading the data.Copyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.