# fromBuffer static method

TrackedFace fromBuffer(

1. Uint8List? data

)

Imports the face object from a buffer.

param data Buffer to import the face object from. return The newly created tracked face. throws FaceException An error has occurred during Face Library execution.

## Implementation

    static TrackedFace fromBuffer(Uint8List? data) {
      TrackedFace trackedFace = TrackedFace();
      Pointer<UnsignedChar>? pData;
      if (data != null) {
      	pData = calloc.allocate<UnsignedChar>(data.length);
      	pData.cast<Uint8>().asTypedList(data.length).setAll(0, data);
      }
      try {
        var err = faceSDK.id3TrackedFace_FromBuffer(trackedFace.handle, pData ?? nullptr, data?.length ?? 0);
        if (err != FaceError.success.value) {
          trackedFace.dispose();
          throw FaceException(err);
        }
        return trackedFace;
      } finally {
        if (pData != null) {
          calloc.free(pData);
        }
      }
    }