Skip to main content

encoder-state

// Save and restore Encoder state with bytes
// Get byte[] of Encoder state
byte[] encoderByteState = flenEncoder.SaveState();

// Restore Encoder with byte[] state
MteStatus encoderStatus = flenEncoder.RestoreState(encoderByteState);
if(encoderStatus != MteStatus.mte_status_success)
{
// Mte cannot continue, handle restore failure appropriately
// Below is only an example
throw new Exception("Failed to restore Encoder state. Status: "
+ flenEncoder.GetStatusName(encoderStatus)+ " / "
+ flenEncoder.GetStatusDescription(encoderStatus));
}
// Save and restore Encoder state with string
// Get string of Encoder state
string encoderStrState = flenEncoder.SaveStateB64();

// Restore Encoder with string state
MteStatus encoderStatus = flenEncoder.RestoreStateB64(encoderStrState);
if(encoderStatus != MteStatus.mte_status_success)
{
// Mte cannot continue, handle restore failure appropriately
// Below is only an example
throw new Exception("Failed to restore Encoder state. Status: "
+ flenEncoder.GetStatusName(encoderStatus)+ " / "
+ flenEncoder.GetStatusDescription(encoderStatus));
}