src/Quahog/Client.php
public function scanResourceStream($stream, $maxChunkSize = 1024)
    {
        if (!is_resource($stream)) {
            throw new InvalidArgumentException('Passed stream is not a resource!');
        }

        $this->_sendCommand("INSTREAM");

        while ($chunk = fread($stream, $maxChunkSize)) {
            $size = pack('N', strlen($chunk));
            $this->_socket->send($size, MSG_DONTROUTE);
            $this->_socket->send($chunk, MSG_DONTROUTE);
        }

        $this->_socket->send(pack('N', 0), MSG_DONTROUTE);

        $response = $this->_receiveResponse();

        return $this->_parseResponse($response);
    }
public function scanResourceStream($stream, $maxChunkSize = 1024)
    {
        if (!is_resource($stream)) {
            throw new InvalidArgumentException('Passed stream is not a resource!');
        }

        $this->_sendCommand("INSTREAM");

        while ($chunk = fread($stream, $maxChunkSize)) {
            $size = pack('N', strlen($chunk));
            $this->_socket->send($size, MSG_DONTROUTE);
            $this->_socket->send($chunk, MSG_DONTROUTE);
        }

        $this->_socket->send(pack('N', 0), MSG_DONTROUTE);

        $response = $this->_receiveResponse();

        return $this->_parseResponse($response);
    }
Scan a stream.

@param resource $stream A file stream
@param int      $maxChunkSize The maximum chunk size in bytes to send to clamd at a time.

@return array
@throws InvalidArgumentException