public function redirect(IOutputStream $aOutputStream = null) { // 从原来的重定向目标设备中解除 if ($this->aRedirectionDev and $this->aRedirectionDev instanceof IBuffRemovable) { $this->aRedirectionDev->removeBuff($this); } // 重定向到新的目标 if ($aOutputStream) { $aOutputStream->write($this); } $this->aRedirectionDev = $aOutputStream; }
/** * @param mixed &$data * @param int $length * @throws EyeIOException */ public function write(&$data, $length = null) { $this->out->write($data, $length); }