public function read($length)
    {
        if (!$this->isConnected()) {
            throw new Rediska_Connection_Exception("Can't read without connection to Redis server. Do connect or write first.");
        }

        if ($length > 0) {
            $data = $this->_readAndThrowException($length);
        } else {
            $data = null;
        }

        if ($length !== -1) {
            $this->_readAndThrowException(2);
        }

        return $data;
    }
public function read($length)
    {
        if (!$this->isConnected()) {
            throw new Rediska_Connection_Exception("Can't read without connection to Redis server. Do connect or write first.");
        }

        if ($length > 0) {
            $data = $this->_readAndThrowException($length);
        } else {
            $data = null;
        }

        if ($length !== -1) {
            $this->_readAndThrowException(2);
        }

        return $data;
    }
public function read ( $ length ) { if ( ! $ this -> isConnected ( ) ) { throw new Rediska_Connection_Exception ( "Can't read without connection to Redis server. Do connect or write first." ) ; } if ( $ length > 0 ) { $ data = $ this -> _readAndThrowException ( $ length ) ; } else { $ data = null ; } if ( $ length !== - 1 ) { $ this -> _readAndThrowException ( 2 ) ; } return $ data ; }
Read length bytes from connection stram

@throws Rediska_Connection_Exception
@param integer $length
@return boolean
Read length bytes from connection stram