|
FlexDoc/Javadoc 2.0 Demo Java Doc |
Instances of Base64.Encoder class are safe for use by multiple concurrent threads.
Unless otherwise noted, passing a null argument to a method of this class will cause a NullPointerException to be thrown.
If the encoded byte output of the needed size can not be allocated, the encode methods of this class will cause an OutOfMemoryError to be thrown.
Method Summary |
||
byte[] |
encode(byte[] src)
Encodes all bytes from the specified byte array into a newly-allocated
byte array using the Base64 encoding scheme.
|
|
int |
encode(byte[] src, byte[] dst)
Encodes all bytes from the specified byte array using the
Base64 encoding scheme, writing the resulting bytes to the
given output byte array, starting at offset 0.
|
|
encode(ByteBuffer buffer)
Encodes all remaining bytes from the specified byte buffer into
a newly-allocated ByteBuffer using the Base64 encoding
scheme.
|
||
encodeToString(byte[] src)
Encodes the specified byte array into a String using the Base64
encoding scheme.
|
||
Returns an encoder instance that encodes equivalently to this one,
but without adding any padding character at the end of the encoded
byte data.
|
||
wrap(OutputStream os)
Wraps an output stream for encoding byte data using the Base64
encoding scheme.
|
Methods inherited from class java.lang.Object |
public byte[] encode |
(byte[] src) |
public int encode |
(byte[] src, byte[] dst) |
It is the responsibility of the invoker of this method to make sure the output byte array dst has enough space for encoding all bytes from the input byte array. No bytes will be written to the output byte array if the output byte array is not big enough.
public String encodeToString |
(byte[] src) |
This method first encodes all input bytes into a base64 encoded byte array and then constructs a new String by using the encoded byte array and the ISO-8859-1 charset.
In other words, an invocation of this method has exactly the same effect as invoking new String(encode(src), StandardCharsets.ISO_8859_1).
public ByteBuffer encode |
(ByteBuffer buffer) |
public OutputStream wrap |
(OutputStream os) |
It is recommended to promptly close the returned output stream after use, during which it will flush all possible leftover bytes to the underlying output stream. Closing the returned output stream will close the underlying output stream.
public Base64.Encoder withoutPadding |
() |
The encoding scheme of this encoder instance is unaffected by this invocation. The returned encoder instance should be used for non-padding encoding operation.
|
FlexDoc/Javadoc 2.0 Demo Java Doc |