.. index:: 
  !FaceLicense.checkLicenseBuffer Method
  
.. _id3_face_face_license_check_license_buffer_class_method:

===============================================================================
FaceLicense.checkLicenseBuffer Method
===============================================================================

Module: :ref:`FaceLicense<id3_face_face_license_class>`

Definition
----------

Checks a license from a buffer.

This function does two things:

- First it loads the license from a buffer

- Then it checks the validity of the license regarding the host it is called on (Windows, Linux, Android ...)

.. important:: Calling one of the license checking function is required to get access to all the license member getters.

.. note:: The optional parameter is required on Android and must be the JNIEnv* pointer casted as a void*. It can be set as NULL for other devices.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        @staticmethod
        check_license_buffer(license_data: bytearray) -> None

      **Parameters**

        .. line-block::

          ``license_data`` bytearray
          :guilabel:`in` A buffer containing the license file data.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        static void checkLicenseBuffer(Uint8List? licenseData)

      **Parameters**

        .. line-block::

          ``licenseData`` Uint8List
          :guilabel:`in` A buffer containing the license file data.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public static void CheckLicenseBuffer(byte[] licenseData)

      **Parameters**

        .. line-block::

          ``licenseData`` byte[]
          :guilabel:`in` A buffer containing the license file data.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public static void checkLicenseBuffer(byte[] licenseData) throws FaceException

      **Parameters**

        .. line-block::

          ``licenseData`` byte[]
          :guilabel:`in` A buffer containing the license file data.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public static func checkLicenseBuffer(licenseData: [UInt8]) throws

      **Parameters**

        .. line-block::

          ``licenseData`` [UInt8]
          :guilabel:`in` A buffer containing the license file data.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3FaceLicense_CheckLicenseBuffer (
            unsigned char * licenseData, 
            int licenseDataSize, 
            void * optionalParameter)

      **Parameters**

        .. line-block::

          ``licenseData`` unsigned char *
          :guilabel:`in` A buffer containing the license file data.

          ``licenseDataSize`` int
          :guilabel:`in` Size of the 'licenseData' buffer.

          ``optionalParameter`` void *
          :guilabel:`in` Only used on Android: JNIEnv* pointer casted as a void*. Ignored for other devices.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


