DataUrlTryGetBytes(ReadOnlyMemoryChar, Byte, String) Method
Tries to retrieve the embedded data as a
Byte array, and also an appropriate file
type extension for this data.
Namespace: FolkerKinzel.DataUrlsAssembly: FolkerKinzel.DataUrls (in FolkerKinzel.DataUrls.dll) Version: 1.0.0+b1c843815044ca6fd87a144c9ff16386002c6473
public static bool TryGetBytes(
ReadOnlyMemory<char> dataUrl,
out byte[]?? bytes,
out string?? fileTypeExtension
)
Public Shared Function TryGetBytes (
dataUrl As ReadOnlyMemory(Of Char),
<OutAttribute> ByRef bytes As Byte(),
<OutAttribute> ByRef fileTypeExtension As String
) As Boolean
public:
static bool TryGetBytes(
ReadOnlyMemory<wchar_t> dataUrl,
[OutAttribute] array<unsigned char>^% bytes,
[OutAttribute] String^% fileTypeExtension
)
static member TryGetBytes :
dataUrl : ReadOnlyMemory<char> *
bytes : byte[] byref *
fileTypeExtension : string byref -> bool
- dataUrl ReadOnlyMemoryChar
- A read-only memory that contains a "data" URL according to RFC 2397.
- bytes Byte
- If the method returns true, the parameter contains the embedded data.
The parameter is passed uninitialized.
- fileTypeExtension String
- If the method returns true, the parameter contains an
appropriate file type extension for bytes. The extension
starts with the period ".". The parameter is passed uninitialized.
Booleantrue if
dataUrl is a valid "data" URL, otherwise
false.
The method fails only if a decoding error occurs. The use of the method is particularly
recommended if the embedded data of the "data" URL should be saved in a file.