public function tell()
{
if (!$this->resource) {
throw new RuntimeException('No resource available; cannot tell position');
}
$result = ftell($this->resource);
if (!is_int($result)) {
throw new RuntimeException('Error occurred during tell operation');
}
return $result;
}