public class Base64 extends Object
Uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for encoding and decoding operation. The encoder does not add any line feed (line separator) character. The decoder rejects data that contains characters outside the base64 alphabet.
Uses the "URL and Filename safe Base64 Alphabet" as specified in Table 2 of RFC 4648 for encoding and decoding. The encoder does not add any line feed (line separator) character. The decoder rejects data that contains characters outside the base64 alphabet.
Uses the "The Base64 Alphabet" as specified in Table 1 of
RFC 2045 for encoding and decoding operation. The encoded output
must be represented in lines of no more than 76 characters each
and uses a carriage return '\r'
followed immediately by
a linefeed '\n'
as the line separator. No line separator
is added to the end of the encoded output. All line separators
or other characters not found in the base64 alphabet table are
ignored in decoding operation.
Unless otherwise noted, passing a null
argument to a
method of this class will cause a NullPointerException
to be thrown.
Modifier and Type | Class and Description |
---|---|
static class |
Base64.Decoder
This class implements a decoder for decoding byte data using the
Base64 encoding scheme as specified in RFC 4648 and RFC 2045.
|
static class |
Base64.Encoder
This class implements an encoder for encoding byte data using
the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.
|
Modifier and Type | Method and Description |
---|---|
static Base64.Decoder |
getDecoder()
Returns a
Base64.Decoder that decodes using the
Basic type base64 encoding scheme. |
static Base64.Encoder |
getEncoder()
Returns a
Base64.Encoder that encodes using the
Basic type base64 encoding scheme. |
static Base64.Decoder |
getMimeDecoder()
Returns a
Base64.Decoder that decodes using the
MIME type base64 decoding scheme. |
static Base64.Encoder |
getMimeEncoder()
Returns a
Base64.Encoder that encodes using the
MIME type base64 encoding scheme. |
static Base64.Encoder |
getMimeEncoder(int lineLength,
byte[] lineSeparator)
Returns a
Base64.Encoder that encodes using the
MIME type base64 encoding scheme
with specified line length and line separators. |
static Base64.Decoder |
getUrlDecoder()
Returns a
Base64.Decoder that decodes using the
URL and Filename safe type base64
encoding scheme. |
static Base64.Encoder |
getUrlEncoder()
Returns a
Base64.Encoder that encodes using the
URL and Filename safe type base64
encoding scheme. |
public static Base64.Encoder getEncoder()
Base64.Encoder
that encodes using the
Basic type base64 encoding scheme.public static Base64.Encoder getUrlEncoder()
Base64.Encoder
that encodes using the
URL and Filename safe type base64
encoding scheme.public static Base64.Encoder getMimeEncoder()
Base64.Encoder
that encodes using the
MIME type base64 encoding scheme.public static Base64.Encoder getMimeEncoder(int lineLength, byte[] lineSeparator)
Base64.Encoder
that encodes using the
MIME type base64 encoding scheme
with specified line length and line separators.lineLength
- the length of each output line (rounded down to nearest multiple
of 4). If lineLength <= 0
the output will not be separated
in lineslineSeparator
- the line separator for each output lineIllegalArgumentException
- if lineSeparator
includes any
character of "The Base64 Alphabet" as specified in Table 1 of
RFC 2045.public static Base64.Decoder getDecoder()
Base64.Decoder
that decodes using the
Basic type base64 encoding scheme.public static Base64.Decoder getUrlDecoder()
Base64.Decoder
that decodes using the
URL and Filename safe type base64
encoding scheme.public static Base64.Decoder getMimeDecoder()
Base64.Decoder
that decodes using the
MIME type base64 decoding scheme. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.