# loadModelBuffer static method

void loadModelBuffer(

1. Uint8List? modelBuffer,
2. DocumentModel documentModel,
3. ProcessingUnit processingUnit

)

Loads a model into memory from the specified buffer.

param modelBuffer A buffer containing the AI model to be loaded. param documentModel Doc model to load. param processingUnit The processing unit to use for the model. throws DocumentException An error has occurred during Document Library execution.

## Implementation

    static void loadModelBuffer(Uint8List? modelBuffer, DocumentModel documentModel, ProcessingUnit processingUnit) {
      Pointer<UnsignedChar>? pModelBuffer;
      if (modelBuffer != null) {
      	pModelBuffer = calloc.allocate<UnsignedChar>(modelBuffer.length);
      	pModelBuffer.cast<Uint8>().asTypedList(modelBuffer.length).setAll(0, modelBuffer);
      }
      try {
        var err = documentSDK.id3DocumentLibrary_LoadModelBuffer(pModelBuffer ?? nullptr, modelBuffer?.length ?? 0, documentModel.value, processingUnit.value);
        if (err != DocumentError.success.value) {
          throw DocumentException(err);
        }
      } finally {
        if (pModelBuffer != null) {
          calloc.free(pModelBuffer);
        }
      }
    }