Functions -
mime
| base64Decode | Deprecated API. Decodes a given input with MIME specific Base64 encoding scheme. |
| base64DecodeBlob | Deprecated API. Decodes a given byte[] with Base64 encoding scheme. |
| base64Encode | Deprecated API. Encodes a given input with MIME specific Base64 encoding scheme. |
| base64EncodeBlob | Deprecated API. Encodes a given byte[] with Base64 encoding scheme. |
| getContentDispositionObject | Given the Content-Disposition as a string, gets the ContentDisposition object with it. |
| getMediaType | Given the Content-Type in string, gets the MediaType object populated with it. |
| prepareDecodingErrorWithDetail | Constructs a |
| prepareEncodingErrorWithDetail | Constructs an |
base64Decode
(string | byte[] | ReadableByteChannel contentToBeDecoded, string charset)
returns string | byte[] | ReadableByteChannel | DecodeErrorDeprecated API. Decodes a given input with MIME specific Base64 encoding scheme.
Parameters
- contentToBeDecoded string | byte[] | ReadableByteChannel
-
Content that needs to be decoded can be of type
string,byte[]orio:ReadableByteChannel
- charset string (default utf-8)
-
Charset to be used. This is used only with the string input
-
Return Type
(string | byte[] | ReadableByteChannel | DecodeError) If the given input is of type string, a decoded
stringis returned. If the given input is of type byte[], a decodedbyte[]is returned. If the given input is of type io:ReadableByteChannel, a decodedio:ReadableByteChannelis returned. In case of errors, anDecodeErrorrecord is returned.
Deprecated API. Decodes a given byte[] with Base64 encoding scheme.
Parameters
- valueToBeDecoded byte[]
-
Content that needs to be decoded
-
Return Type
(byte[] | DecodeError) A decoded
byte[]. In case of errors, anDecodeErrorrecord is returned
base64Encode
(string | byte[] | ReadableByteChannel contentToBeEncoded, string charset)
returns string | byte[] | ReadableByteChannel | EncodeErrorDeprecated API. Encodes a given input with MIME specific Base64 encoding scheme.
Parameters
- contentToBeEncoded string | byte[] | ReadableByteChannel
-
Content that needs to be encoded can be of type
string,byte[]orio:ReadableByteChannel
- charset string (default utf-8)
-
Charset to be used. This is used only with the string input
-
Return Type
(string | byte[] | ReadableByteChannel | EncodeError) If the given input is of type string, an encoded
stringis returned. If the given input is of type byte[], an encodedbyte[]is returned. If the given input is of type io:ReadableByteChannel, an encodedio:ReadableByteChannelis returned. In case of errors, anEncodeErrorrecord is returned.
Deprecated API. Encodes a given byte[] with Base64 encoding scheme.
Parameters
- valueToBeEncoded byte[]
-
Content that needs to be encoded
-
Return Type
(byte[] | EncodeError) An encoded byte[]. In case of errors, an
EncodeErrorrecord is returned
Given the Content-Disposition as a string, gets the ContentDisposition object with it.
Parameters
- contentDisposition string
-
Content disposition string
-
Return Type
(ContentDisposition) A
ContentDispositionobject
Given the Content-Type in string, gets the MediaType object populated with it.
Parameters
- contentType string
-
Content-Type in string
-
Return Type
(MediaType | InvalidContentTypeError) MediaTypeobject or an error in case of invalid content-type
Constructs a DecodeError with the given details.
Parameters
- detail string
-
error details
-
Return Type
(DecodeError) DecodeErrorwith the given details set to message
Constructs an EncodeError with the given details.
Parameters
- detail string
-
error details
-
Return Type
(EncodeError) EncodeErrorwith the given details set to message