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);
        }
    }