/**
  * Gets the IANA content type (aka media type) of the stream associated with 
  * the specified media resource.
  * 
  * @param object             $entity             The entity instance 
  *                                               (media resource) associated with
  *                                               the stream for which the content
  *                                               type is to be obtained.
  * @param ResourceStreamInfo $resourceStreamInfo This will be null if 
  *                                               media resource is MLE, 
  *                                               if media resource is named
  *                                               stream then will be the 
  *                                               ResourceStreamInfo instance 
  *                                               holding the details of 
  *                                               named stream.
  * 
  * @return string|null
  */
 public function getStreamContentType($entity, $resourceStreamInfo)
 {
     $contentType = null;
     $this->_saveContentTypeAndETag();
     if (is_null($resourceStreamInfo)) {
         $this->_loadAndValidateStreamProvider();
         $contentType = $this->_streamProvider->getStreamContentType($entity, $this->_service->getOperationContext());
         if (is_null($contentType)) {
             throw new InvalidOperationException(Messages::streamProviderWrapperGetStreamContentTypeReturnsEmptyOrNull());
         }
     } else {
         $this->_loadAndValidateStreamProvider2();
         $contentType = $this->_streamProvider->getStreamContentType2($entity, $resourceStreamInfo, $this->_service->getOperationContext());
     }
     $this->_verifyContentTypeOrETagModified('IDSSP::getStreamContentType');
     return $contentType;
 }