/* This function decodes the content. The Memory block pointed by ContentPointer would be freed and replaced with the cooked Redfish payload. */
EFI_STATUS DecodeResponseContent(IN CHAR8 *ContentEncodedValue, IN OUT VOID **ContentPointer, IN OUT UINTN *ContentLength)
/* This function decodes the content. The Memory block pointed by ContentPointer would be freed and replaced with the cooked Redfish payload. */
EFI_STATUS DecodeResponseContent(IN CHAR8 *ContentEncodedValue, IN OUT VOID **ContentPointer, IN OUT UINTN *ContentLength)
{
  EFI_STATUS  Status;
  VOID        *DecodedPointer;
  UINTN       DecodedLength;
  if (ContentEncodedValue == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Status = RedfishContentDecode (
             ContentEncodedValue,
             *ContentPointer,
             *ContentLength,
             &DecodedPointer,
             &DecodedLength
             );
  if (Status == EFI_SUCCESS) {
    FreePool (*ContentPointer);
    *ContentPointer = DecodedPointer;
    *ContentLength  = DecodedLength;
  }
  return Status;
}