Functions -
mime
base64Decode |
Deprecated API. |
base64DecodeBlob |
Deprecated API. |
base64Encode |
Deprecated API. |
base64EncodeBlob |
Deprecated API. |
getContentDispositionObject |
Given the Content-Disposition as a string, gets the ContentDisposition object with it. |
getMediaType |
Gets the |
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) A decoded
string
if the given input is of type string, a decodedbyte[]
if the given input is of type byte[], a decodedio:ReadableByteChannel
if the given input is of type io:ReadableByteChannel or else amime:DecodeError
in case of errors
Deprecated API. Decodes a given byte[] using the Base64 encoding scheme.
Parameters
- valueToBeDecoded byte[]
-
Content, which needs to be decoded
-
Return Type
(byte[] | DecodeError) A decoded
byte[]
or else amime:DecodeError
record in case of errors
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) An encoded
string
if the given input is of type string, an encodedbyte[]
if the given input is of type byte[], an encodedio:ReadableByteChannel
if the given input is of typeio:ReadableByteChannel
, or else amime:EncodeError
record in case of errors
Deprecated API. Encodes a given byte[] using the Base64 encoding scheme.
Parameters
- valueToBeEncoded byte[]
-
Content, which needs to be encoded
-
Return Type
(byte[] | EncodeError) An encoded byte[] or else a
mime:EncodeError
record in case of errors
Given the Content-Disposition as a string, gets the ContentDisposition object with it.
Parameters
- contentDisposition string
-
Content disposition string
-
Return Type
(ContentDisposition) A
ContentDisposition
object
Gets the MediaType
object populated with it when the Content-Type
is in string.
Parameters
- contentType string
-
Content-Type in string
-
Return Type
(MediaType | InvalidContentTypeError) MediaType
object or else amime:InvalidContentTypeError
in case of an invalid content-type
Constructs a DecodeError
with the given details.
Parameters
- detail string
-
Error details
-
Return Type
(DecodeError) DecodeError
with the given details set to the message
Constructs an EncodeError
with the given details.
Parameters
- detail string
-
Error details
-
Return Type
(EncodeError) An
EncodeError
with the given details set to the message