public Torrent(byte[] torrent) throws IllegalArgumentException {
		this.encoded = torrent;

		try {
			this.decoded = BDecoder.bdecode(
					new ByteArrayInputStream(this.encoded)).getMap();

			this.announceUrl = this.decoded.get("announce").getString();

			this.decoded_info = this.decoded.get("info").getMap();
			this.name = this.decoded_info.get("name").getString();

			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			BEncoder.bencode(this.decoded_info, baos);
			this.encoded_info = baos.toByteArray();
			this.info_hash = Torrent.hash(this.encoded_info);
			this.hex_info_hash = Torrent.byteArrayToHexString(this.info_hash);
		} catch (Exception e) {
			throw new IllegalArgumentException("Can't parse torrent information!", e);
		}
	}