function filter($in, $out, &$consumed, $closing)
    {
        $unfiltered = $this->_getDataFromBucket($in, $consumed);

        // Filter Stream Data:
        $filtered = $unfiltered;
        foreach ($this->params['bad_words'] as $badWord) {
            $regex = "[(^|\s)({$badWord})($|\s)]i";
            preg_match_all($regex, $filtered, $matches);
            $filtered = preg_replace($regex, "$1{$this->_getReplacement()}$3", $filtered);
        }

        // Write Down Back Filtered Data To Stream:
        return $this->_writeBackDataOut($out, $filtered);
    }