public function dataToBinary($val)
    {
        $saved_object_count = $this->writtenObjectCount++;

        $bdata = self::typeBytes("4", strlen($val)); // a is 1000, type indicator for data
        $this->objectTable[$saved_object_count] = $bdata.$val;

        return $saved_object_count;
    }