public function seek($offset, $whence = SEEK_SET)
{
if (!$this->isSeekable()) {
throw new WriteException('Cannt seek on this kind of stream.');
}
$pointer = fseek($this->resource, $offset, $whence);
if ($pointer === false) {
throw new WriteException('Cannot seek on stream.');
}
$this->emit('seek', [$this, $pointer]);
}