Class Downloader
java.lang.Object
uk.ac.manchester.spinnaker.protocols.download.Downloader
- All Implemented Interfaces:
AutoCloseable
Class used to manage a download. Every instance must only ever
be used from one thread.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()doDownload(HasCoreLocation monitorCore, MemoryLocation address, int size) Do the downloading.voidreuse()Prepare to reuse the downloader.
-
Field Details
-
log
Logger for the gatherer.
-
-
Constructor Details
-
Downloader
@MustBeClosed public Downloader(IPTag iptag) throws IOException, ProcessException, InterruptedException Create an instance.- Parameters:
iptag- The tag to reprogram to talk to this connection.- Throws:
IOException- If IO fails.ProcessException- If SpiNNaker rejects the reprogramming.InterruptedException- If communications are interrupted.
-
-
Method Details
-
reuse
Prepare to reuse the downloader.- Throws:
IOException- If IO fails.ProcessException- If SpiNNaker rejects the reprogramming.InterruptedException- If communications are interrupted.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
doDownload
public ByteBuffer doDownload(HasCoreLocation monitorCore, MemoryLocation address, int size) throws IOException, ProcessException, InterruptedException Do the downloading.- Parameters:
monitorCore- The core to download from.address- The address to download from.size- The size of the download.- Returns:
- The downloaded data, or
nullif an unrecoverable error occurred. - Throws:
IOException- If anything unexpected goes wrong.ProcessException- If anything unexpected goes wrong.InterruptedException- If communications are interrupted.
-