Base64Codec
@Deprecated public class Base64Converter extends Object
The basic encode and decode methods read and write from arbitrary segments
of existing byte[]
s. These are meant to be used with buffers
created and filled by the calling code.
Constructor and Description |
---|
Base64Converter()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] src)
Deprecated.
Convenience method to decode an entire array of Base64 characters into
its corresponding
byte[] . |
static int |
decode(byte[] src,
int off,
int len,
byte[] dst,
int doff)
Deprecated.
Decodes the specified segment of a source
byte[] as Base64
characters, inserting the decoded bytes at the specified offset of a
destination array. |
static byte[] |
decode(String src)
Deprecated.
Convenience method to decode a string of Base64 characters into its
corresponding
byte[] , ignoring any illegal characters. |
static byte[] |
encode(byte[] src)
Deprecated.
Convenience method that creates a correctly-sized output array, and
Base64 encodes the source array into it.
|
static int |
encode(byte[] src,
int off,
int len,
byte[] dst,
int doff)
Deprecated.
Encodes the specified segment of a source
byte[] as Base64
characters at the specified offset of a destination array. |
static boolean |
isBase64Char(char c)
Deprecated.
Determines whether the passed character is a valid Base64 encoding
character.
|
public static boolean isBase64Char(char c)
public static int encode(byte[] src, int off, int len, byte[] dst, int doff)
byte[]
as Base64
characters at the specified offset of a destination array. Caller is
responsible for ensuring that the destination array is large enough to
hold all encoded bytes.src
- Source data.off
- Offset within the source data to start encoding.len
- Number of bytes to encode from source data.dst
- Destination for encoded bytes. Since Base64 produces
only ASCII data, which is typically written directly
to a stream, this is a byte[]
rather
than a char[]
.doff
- Offset within destination where encoded bytes are
written.public static byte[] encode(byte[] src)
public static int decode(byte[] src, int off, int len, byte[] dst, int doff)
byte[]
as Base64
characters, inserting the decoded bytes at the specified offset of a
destination array. Caller is responsible for ensuring that this array
can hold all decoded bytes.
The source array may not contain non-Base64 characters. The segment length must be a multiple of 4, padded if necessary with '=' characters.
src
- Source data, containing Base64 encoded characters.off
- Offset within the source data to start decoding.len
- Number of bytes to decode from source data. This must
be a multiple of 4.dst
- Destination for decoded bytes.doff
- Offset within destination where dencoded bytes are
written.public static byte[] decode(byte[] src)
byte[]
.public static byte[] decode(String src)
byte[]
, ignoring any illegal characters.