protected function makeKeyString($key): string {
        //convert numbers to strings.
        $stringValue = (string)$key;
        $length = strlen( $stringValue );
        if( $length == 0 ){
            throw new \Exception("Key values must be string values of at least 1 character. Empty strings cannot be used as indices in Binn format object containers." );
        }
        if( $length > 255 ){
            throw new \Exception("Unable to write this object in Binn Format. The Binn format OBJECT container is limited to string key lengths of 255 characters or less; one of the keys in this object violate this length rule.");
        }
        $byteSize = chr( $length );
        return $byteSize . $stringValue;
    }