getExpiryDate static method
Retrieves the license expiry date.
return The license expiry date. throws DocumentException An error has occurred during Document Library execution.
Implementation
static String getExpiryDate() {
Pointer<Char> pExpiryDate = calloc.allocate(256);
Pointer<Int> pExpiryDateSize = calloc.allocate(1);
pExpiryDateSize[0] = 256;
try {
var err = documentSDK.id3DocumentLicense_GetExpiryDate(pExpiryDate, pExpiryDateSize);
if (err == DocumentError.insufficientBuffer.value) {
calloc.free(pExpiryDate);
pExpiryDate = calloc.allocate(pExpiryDateSize.value);
err = documentSDK.id3DocumentLicense_GetExpiryDate(pExpiryDate, pExpiryDateSize);
if (err != DocumentError.success.value) {
throw DocumentException(err);
}
}
final vExpiryDate = utf8.decode(Uint8List.fromList(pExpiryDate.cast<Uint8>().asTypedList(pExpiryDateSize.value)));
return vExpiryDate;
} finally {
calloc.free(pExpiryDate);
calloc.free(pExpiryDateSize);
}
}