/** * Встановити дані файла торента * @param $torrent * @throws TorrentException */ protected function setBinaryTorrent($torrent) { try { TorrentDecoder::decode($this, $torrent); } catch (\Exception $e) { throw new TorrentException('NOT_FORMAT_TORRENT'); } }
/** * Отримати вміст torrent файла * @return string */ public function getBinaryTorrent() { return TorrentDecoder::encode($this); }