PhpOrient\Protocols\Binary\Abstracts\Operation::_readBytes PHP Method

_readBytes() protected method

Read bytes from the socket.
protected _readBytes ( ) : string | null
return string | null the bytes read, or null if it's empty.
    protected function _readBytes()
    {
        $length = $this->_readInt();
        if ($length === -1) {
            return null;
        } else {
            if ($length === 0) {
                return '';
            } else {
                $this->_input_buffer .= $string = $this->_socket->read($length);
                return $string;
            }
        }
    }