public function rewind() { if (!$this->isSeekable()) { throw new WriteException('Cannt rewind this kind of stream.'); } if (false === rewind($this->resource)) { throw new WriteException('Cannot rewind stream.'); } }