*/ class Bytes implements \Serializable { /** * The container for the binary-string * @var string */ public $s; /** * Constructor for \Aerospike\Bytes class. * * @param string $bin_str a PHP binary-string such as gzdeflate() produces. */ public function __construct($bin_str) { $this->s = $bin_str; } /** * Returns a serialized representation of the binary-string. * Called by serialize() * * @return string */ public function serialize() { return $this->s; } /** * Re-wraps the binary-string when called by unserialize(). * * @param string $bin_str a PHP binary-string. Called by unserialize(). * @return string */ public function unserialize($bin_str) { return $this->s = $bin_str; } /** * Returns the binary-string held in the \Aerospike\Bytes object. * * @return string */ public function __toString() { return $this->s; } /** * Unwraps an \Aerospike\Bytes object, returning the binary-string inside. * * @param \Aerospike\Bytes $bytes_wrap * @return string */ public static function unwrap(Bytes $bytes_wrap) { return $bytes_wrap->s; } }