public function serialize(/*mixed*/ $data) 
    {
        if (null === $data) {
            return $this->serializeInt(null);
        }
        elseif (is_array($data)) {
            return $this->serializeUInt8($data);
        }
        elseif (is_integer($data)) {
            return $this->serializeLong($data);
        }
        elseif (is_string($data)) {
            return $this->serializeString($data);
        }
        elseif ($data instanceof Serializable) {
            return $data->serialize();
        }

        throw new RuntimeException("Invalid parameter provided to \\NEM\\Core\\Serialize::serialize().");
    }