'Internal class method that reads a torrent file from stream,
checks it for correctness and sets self.input and self.metainfo
accordingly.'

def _read(stream):

    bdata = stream.read()
    stream.close()
    data = bdecode(bdata)
    return TorrentDef._create(data)
