public TorrentByteStorage(File file, long size) throws IOException {
		this.target = file;
		this.size = size;

		this.partial = new File(this.target.getAbsolutePath() +
			TorrentByteStorage.PARTIAL_FILE_NAME_SUFFIX);

		if (this.partial.exists()) {
			logger.info("Partial download found at " +
				this.partial.getAbsolutePath() + ". Continuing...");
			this.current = this.partial;
		} else if (!this.target.exists()) {
			logger.info("Downloading new file to " +
				this.partial.getAbsolutePath() + "...");
			this.current = this.partial;
		} else {
			logger.info("Using existing file " +
				this.target.getAbsolutePath() + ".");
			this.current = this.target;
		}

		this.raf = new RandomAccessFile(this.current, "rw");

		// Set the file length to the appropriate size, eventually truncating
		// or extending the file if it already exists with a different size.
		this.raf.setLength(this.size);

		this.channel = raf.getChannel();
		logger.debug("Initialized torrent byte storage at " +
			this.current.getAbsolutePath() + ".");
	}