public function writeDuration(QtiDuration $duration)
    {
        try {
            $this->writeString($duration->__toString());
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing a duration.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::DURATION, $e);
        }
    }
public function writeDuration(QtiDuration $duration)
    {
        try {
            $this->writeString($duration->__toString());
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing a duration.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::DURATION, $e);
        }
    }
public function writeDuration ( QtiDuration $ duration ) { try { $ this -> writeString ( $ duration -> __toString ( ) ) ; } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing a duration." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: DURATION , $ e ) ; } }
Write a Duration in the current binary stream.

@param \qtism\common\datatypes\Duration $duration A Duration object.
@throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
Write a Duration in the current binary stream .