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().");
    }
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().");
    }
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()." ) ; }
Serialize any input for the NEM network.

@param   array|string|integer|\NEM\Core\Serializer   $data
@return  array       Returns a byte-array with values in UInt8 representation.
@throws  RuntimeException    On unrecognized `data` argument.
Serialize any input for the NEM network .