Share via


Base64.Decoder.Decode Method

Definition

Overloads

Decode(ByteBuffer)

Decodes all bytes from the input byte buffer using the Base64 encoding scheme, writing the results into a newly-allocated ByteBuffer.

Decode(Byte[])

Decodes all bytes from the input byte array using the Base64 encoding scheme, writing the results into a newly-allocated output byte array.

Decode(String)

Decodes a Base64 encoded String into a newly-allocated byte array using the Base64 encoding scheme.

Decode(Byte[], Byte[])

Decodes all bytes from the input byte array using the Base64 encoding scheme, writing the results into the given output byte array, starting at offset 0.

Decode(ByteBuffer)

Decodes all bytes from the input byte buffer using the Base64 encoding scheme, writing the results into a newly-allocated ByteBuffer.

[Android.Runtime.Register("decode", "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;", "GetDecode_Ljava_nio_ByteBuffer_Handler", ApiSince=26)]
public virtual Java.Nio.ByteBuffer? Decode (Java.Nio.ByteBuffer? buffer);
[<Android.Runtime.Register("decode", "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;", "GetDecode_Ljava_nio_ByteBuffer_Handler", ApiSince=26)>]
abstract member Decode : Java.Nio.ByteBuffer -> Java.Nio.ByteBuffer
override this.Decode : Java.Nio.ByteBuffer -> Java.Nio.ByteBuffer

Parameters

buffer
ByteBuffer

the ByteBuffer to decode

Returns

A newly-allocated byte buffer containing the decoded bytes

Attributes

Remarks

Decodes all bytes from the input byte buffer using the Base64 encoding scheme, writing the results into a newly-allocated ByteBuffer.

Upon return, the source buffer's position will be updated to its limit; its limit will not have been changed. The returned output buffer's position will be zero and its limit will be the number of resulting decoded bytes

IllegalArgumentException is thrown if the input buffer is not in valid Base64 encoding scheme. The position of the input buffer will not be advanced in this case.

Java documentation for java.util.Base64.Decoder.decode(java.nio.ByteBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Decode(Byte[])

Decodes all bytes from the input byte array using the Base64 encoding scheme, writing the results into a newly-allocated output byte array.

[Android.Runtime.Register("decode", "([B)[B", "GetDecode_arrayBHandler", ApiSince=26)]
public virtual byte[]? Decode (byte[]? src);
[<Android.Runtime.Register("decode", "([B)[B", "GetDecode_arrayBHandler", ApiSince=26)>]
abstract member Decode : byte[] -> byte[]
override this.Decode : byte[] -> byte[]

Parameters

src
Byte[]

the byte array to decode

Returns

Byte[]

A newly-allocated byte array containing the decoded bytes.

Attributes

Remarks

Decodes all bytes from the input byte array using the Base64 encoding scheme, writing the results into a newly-allocated output byte array. The returned byte array is of the length of the resulting bytes.

Java documentation for java.util.Base64.Decoder.decode(byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Decode(String)

Decodes a Base64 encoded String into a newly-allocated byte array using the Base64 encoding scheme.

[Android.Runtime.Register("decode", "(Ljava/lang/String;)[B", "GetDecode_Ljava_lang_String_Handler", ApiSince=26)]
public virtual byte[]? Decode (string? src);
[<Android.Runtime.Register("decode", "(Ljava/lang/String;)[B", "GetDecode_Ljava_lang_String_Handler", ApiSince=26)>]
abstract member Decode : string -> byte[]
override this.Decode : string -> byte[]

Parameters

src
String

the string to decode

Returns

Byte[]

A newly-allocated byte array containing the decoded bytes.

Attributes

Remarks

Decodes a Base64 encoded String into a newly-allocated byte array using the Base64 encoding scheme.

An invocation of this method has exactly the same effect as invoking decode(src.getBytes(StandardCharsets.ISO_8859_1))

Java documentation for java.util.Base64.Decoder.decode(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Decode(Byte[], Byte[])

Decodes all bytes from the input byte array using the Base64 encoding scheme, writing the results into the given output byte array, starting at offset 0.

[Android.Runtime.Register("decode", "([B[B)I", "GetDecode_arrayBarrayBHandler", ApiSince=26)]
public virtual int Decode (byte[]? src, byte[]? dst);
[<Android.Runtime.Register("decode", "([B[B)I", "GetDecode_arrayBarrayBHandler", ApiSince=26)>]
abstract member Decode : byte[] * byte[] -> int
override this.Decode : byte[] * byte[] -> int

Parameters

src
Byte[]

the byte array to decode

dst
Byte[]

the output byte array

Returns

The number of bytes written to the output byte array

Attributes

Remarks

Decodes all bytes from the input byte array using the Base64 encoding scheme, writing the results into the given output byte array, starting at offset 0.

It is the responsibility of the invoker of this method to make sure the output byte array dst has enough space for decoding 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.

If the input byte array is not in valid Base64 encoding scheme then some bytes may have been written to the output byte array before IllegalargumentException is thrown.

Java documentation for java.util.Base64.Decoder.decode(byte[], byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to