public function writeString($string)
    {
        // $maxLen = 2^16 -1 = max val of unsigned short integer.
        $maxLen = 65535;
        $len = strlen($string);

        if ($len > $maxLen) {
            $len = $maxLen;
            $string = substr($string, 0, $maxLen);
        }

        try {
            $this->getStream()->write(pack('S', $len) . $string);
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::STRING, false);
        }
    }
public function writeString($string)
    {
        // $maxLen = 2^16 -1 = max val of unsigned short integer.
        $maxLen = 65535;
        $len = strlen($string);

        if ($len > $maxLen) {
            $len = $maxLen;
            $string = substr($string, 0, $maxLen);
        }

        try {
            $this->getStream()->write(pack('S', $len) . $string);
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::STRING, false);
        }
    }
public function writeString ( $ string ) { // $maxLen = 2^16 -1 = max val of unsigned short integer. $ maxLen = 65535 ; $ len = strlen ( $ string ) ; if ( $ len > $ maxLen ) { $ len = $ maxLen ; $ string = substr ( $ string , 0 , $ maxLen ) ; } try { $ this -> getStream ( ) -> write ( pack ( 'S' , $ len ) . $ string ) ; } catch ( StreamException $ e ) { $ this -> handleStreamException ( $ e , BinaryStreamAccessException :: STRING , false ) ; } }
Write a string value from in the current binary string.

@param string $string
@throws \qtism\common\storage\BinaryStreamAccessException
Write a string value from in the current binary string .