public function writeRecordField(array $recordField, $isNull = false)
    {
        try {
            $this->writeBoolean($isNull);
            $key = $recordField[0];
            $this->writeString($key);

            if ($isNull === false) {
                $value = $recordField[1];
                $baseType = Utils::inferBaseType($value);

                $this->writeTinyInt($baseType);
                $toCall = 'write' . ucfirst(BaseType::getNameByConstant($baseType));

                call_user_func(array($this, $toCall), ($value instanceof QtiScalar) ? $value->getValue() : $value);
            }
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing a Record Field.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::RECORDFIELD);
        }
    }
public function writeRecordField(array $recordField, $isNull = false)
    {
        try {
            $this->writeBoolean($isNull);
            $key = $recordField[0];
            $this->writeString($key);

            if ($isNull === false) {
                $value = $recordField[1];
                $baseType = Utils::inferBaseType($value);

                $this->writeTinyInt($baseType);
                $toCall = 'write' . ucfirst(BaseType::getNameByConstant($baseType));

                call_user_func(array($this, $toCall), ($value instanceof QtiScalar) ? $value->getValue() : $value);
            }
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing a Record Field.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::RECORDFIELD);
        }
    }
public function writeRecordField ( array $ recordField , $ isNull = false ) { try { $ this -> writeBoolean ( $ isNull ) ; $ key = $ recordField [ 0 ] ; $ this -> writeString ( $ key ) ; if ( $ isNull === false ) { $ value = $ recordField [ 1 ] ; $ baseType = Utils :: inferBaseType ( $ value ) ; $ this -> writeTinyInt ( $ baseType ) ; $ toCall = 'write' . ucfirst ( BaseType :: getNameByConstant ( $ baseType ) ) ; call_user_func ( array ( $ this , $ toCall ) , ( $ value instanceof QtiScalar ) ? $ value -> getValue ( ) : $ value ) ; } } catch ( BinaryStreamAccessException $ e ) { $ msg = "An error occured while writing a Record Field." ; throw new QtiBinaryStreamAccessException ( $ msg , $ this , QtiBinaryStreamAccessException :: RECORDFIELD ) ; } }
Write a record field value in the current binary stream. A record field is composed of a key string and a value.

@param array $recordField An array where index 0 is the key string, and the index 1 is the value.
@throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException
Write a record field value in the current binary stream . A record field is composed of a key string and a value .