java.lang.Object | |
↳ | android.util.Base64 |
Utilities for encoding and decoding the Base64 representation of binary data. See RFCs 2045 and 3548 .
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | CRLF | Encoder flag bit to indicate lines should be terminated with a CRLF pair instead of just an LF. | |||||||||
int | DEFAULT | Default values for encoder/decoder flags. | |||||||||
int | NO_CLOSE |
Flag to pass to
Base64OutputStream
to indicate that it
should not close the output stream it is wrapping when it
itself is closed.
|
|||||||||
int | NO_PADDING | Encoder flag bit to omit the padding '=' characters at the end of the output (if any). | |||||||||
int | NO_WRAP | Encoder flag bit to omit all line terminators (i.e., the output will be on one long line). | |||||||||
int | URL_SAFE |
Encoder/decoder flag bit to indicate using the "URL and
filename safe" variant of Base64 (see RFC 3548 section 4) where
-
and
_
are used in place of
+
and
/
.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Decode the Base64-encoded data in input and return the data in
a new byte array.
|
||||||||||
|
Decode the Base64-encoded data in input and return the data in
a new byte array.
|
||||||||||
|
Decode the Base64-encoded data in input and return the data in
a new byte array.
|
||||||||||
|
Base64-encode the given data and return a newly allocated
byte[] with the result.
|
||||||||||
|
Base64-encode the given data and return a newly allocated
byte[] with the result.
|
||||||||||
|
Base64-encode the given data and return a newly allocated
String with the result.
|
||||||||||
|
Base64-encode the given data and return a newly allocated
String with the result.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Encoder flag bit to indicate lines should be terminated with a
CRLF pair instead of just an LF. Has no effect if
NO_WRAP
is specified as well.
Default values for encoder/decoder flags.
Flag to pass to
Base64OutputStream
to indicate that it
should not close the output stream it is wrapping when it
itself is closed.
Encoder flag bit to omit the padding '=' characters at the end of the output (if any).
Encoder flag bit to omit all line terminators (i.e., the output will be on one long line).
Encoder/decoder flag bit to indicate using the "URL and
filename safe" variant of Base64 (see RFC 3548 section 4) where
-
and
_
are used in place of
+
and
/
.
Decode the Base64-encoded data in input and return the data in a new byte array.
The padding '=' characters at the end are considered optional, but if any are present, there must be the correct number of them.
input | the data to decode |
---|---|
offset | the position within the input array at which to start |
len | the number of bytes of input to decode |
flags |
controls certain features of the decoded output.
Pass
DEFAULT
to decode standard Base64.
|
IllegalArgumentException | if the input contains incorrect padding |
---|
Decode the Base64-encoded data in input and return the data in a new byte array.
The padding '=' characters at the end are considered optional, but if any are present, there must be the correct number of them.
input | the input array to decode |
---|---|
flags |
controls certain features of the decoded output.
Pass
DEFAULT
to decode standard Base64.
|
IllegalArgumentException | if the input contains incorrect padding |
---|
Decode the Base64-encoded data in input and return the data in a new byte array.
The padding '=' characters at the end are considered optional, but if any are present, there must be the correct number of them.
str | the input String to decode, which is converted to bytes using the default charset |
---|---|
flags |
controls certain features of the decoded output.
Pass
DEFAULT
to decode standard Base64.
|
IllegalArgumentException | if the input contains incorrect padding |
---|
Base64-encode the given data and return a newly allocated byte[] with the result.
input | the data to encode |
---|---|
flags |
controls certain features of the encoded output.
Passing
DEFAULT
results in output that
adheres to RFC 2045.
|
Base64-encode the given data and return a newly allocated byte[] with the result.
input | the data to encode |
---|---|
offset | the position within the input array at which to start |
len | the number of bytes of input to encode |
flags |
controls certain features of the encoded output.
Passing
DEFAULT
results in output that
adheres to RFC 2045.
|
Base64-encode the given data and return a newly allocated String with the result.
input | the data to encode |
---|---|
offset | the position within the input array at which to start |
len | the number of bytes of input to encode |
flags |
controls certain features of the encoded output.
Passing
DEFAULT
results in output that
adheres to RFC 2045.
|
Base64-encode the given data and return a newly allocated String with the result.
input | the data to encode |
---|---|
flags |
controls certain features of the encoded output.
Passing
DEFAULT
results in output that
adheres to RFC 2045.
|