public function setContentStream(StreamInterface $contentStream, $overwrite, $refresh = true)
    {
        $newObjectId = $this->getId();
        $changeToken = $this->getPropertyValue(PropertyIds::CHANGE_TOKEN);

        $this->getBinding()->getObjectService()->setContentStream(
            $this->getRepositoryId(),
            $newObjectId,
            $this->getObjectFactory()->convertContentStream($contentStream),
            $overwrite,
            $changeToken
        );

        if ($refresh === true) {
            $this->refresh();
        }

        if ($newObjectId === null) {
            return null;
        }

        return $this->getSession()->createObjectId($newObjectId);
    }