function read($len = null)
{
if (!$this->getInitialized()) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if ($buffer === -1) {
return -1;
}
$lines = explode("\n", $buffer);
$filtered = array();
$commentsSize = count($this->_comments);
foreach ($lines as $line) {
for ($i = 0; $i < $commentsSize; $i++) {
$comment = $this->_comments[$i]->getValue();
if (StringHelper::startsWith($comment, ltrim($line))) {
$line = null;
break;
}
}
if ($line !== null) {
$filtered[] = $line;
}
}
$filtered_buffer = implode("\n", $filtered);
return $filtered_buffer;
}