Skip to main content

decoder-state

// Save and restore Decoder state with bytes
// Get byte[] of decoder state
byte[] decoderByteState = mteDecoder.SaveState();

// Restore Decoder with byte[] state
MteStatus decoderStatus = mteDecoder.RestoreState(decoderByteState);
if(decoderStatus != MteStatus.mte_status_success)
{
// Decoder restore failed, handle appropriately
// Below is only an example
throw new Exception("Failed to restore Decoder state. Status: "
+ mteDecoder.GetStatusName(decoderStatus)+ " / "
+ mteDecoder.GetStatusDescription(decoderStatus));
}
// save and restore Decoder state with string
// Get string of Decoder state
string decoderStrState = mteDecoder.SaveStateB64();

// Restore Decoder with string state
MteStatus decoderStatus = mteDecoder.RestoreStateB64(decoderStrState);
if(decoderStatus != MteStatus.mte_status_success)
{
// Decoder restore failed, handle appropriately
// Below is only an example
throw new Exception("Failed to restore Decoder state. Status: "
+ mteDecoder.GetStatusName(decoderStrStatus)+ " / "
+ mteDecoder.GetStatusDescription(decoderStrStatus));
}