public function offset()
{
$files = array();
$size = 0;
if (isset($this->info['files']) && is_array($this->info['files'])) {
foreach ($this->info['files'] as $file) {
$files[self::path($file['path'], $this->info['name'])] = array('startpiece' => floor($size / $this->info['piece length']), 'offset' => fmod($size, $this->info['piece length']), 'size' => $size += $file['length'], 'endpiece' => floor($size / $this->info['piece length']));
}
} elseif (isset($this->info['name'])) {
$files[$this->info['name']] = array('startpiece' => 0, 'offset' => 0, 'size' => $this->info['length'], 'endpiece' => floor($this->info['length'] / $this->info['piece length']));
}
return $files;
}