getOutputData method

Uint8List getOutputData()

Gets the holds the decoded data extracted from the barcode.

return Holds the decoded data extracted from the barcode. throws BiosealException An error has occurred during Bioseal Library execution.

Implementation

Uint8List getOutputData() {
  Pointer<UnsignedChar> pOutputData = nullptr;
  Pointer<Int> pOutputDataSize = calloc();
  pOutputDataSize[0] = -1;
  try {
    var err = biosealSDK.id3BiosealBarcodeReader_GetOutputData(_pHandle.value, pOutputData, pOutputDataSize);
    if (err == BiosealError.insufficientBuffer.value) {
      pOutputData = calloc.allocate(pOutputDataSize.value);
      err = biosealSDK.id3BiosealBarcodeReader_GetOutputData(_pHandle.value, pOutputData, pOutputDataSize);
    }
    if (err != BiosealError.success.value) {
      throw BiosealException(err);
    }
    final vOutputData = Uint8List.fromList(pOutputData.cast<Uint8>().asTypedList(pOutputDataSize.value));
    return vOutputData;
  } finally {
    calloc.free(pOutputData);
    calloc.free(pOutputDataSize);
  }
}