public interface IOHandler
| Modifier and Type | Method and Description |
|---|---|
void |
log(String message)
Called during download with logging messages.
|
void |
progress(long bytes,
long total)
Called during download with progress data.
|
Byte |
read(int msTimeout)
Called during download to read the next input byte.
|
void |
received(Download download)
Called at end of successful download with details of downloaded file.
|
void |
write(char ch)
Called during download to send a byte to the sender.
|
Byte read(int msTimeout) throws UserCancelException
Blocks until the next byte is available. If timeout is reached, return null. If user cancels the download while blocked, throw DownloadCancelException.
msTimeout - Milliseconds to wait before timing out.UserCancelException - If user cancelled the download.void write(char ch)
ch - Byte to transmit.void log(String message)
message - Message to log.void progress(long bytes,
long total)
bytes - Number of bytes downloaded so far.total - Total size of file being downloaded (0 if unknown).void received(Download download)
download - Download object with details of downloaded file, including a reference to it.Copyright © 2019. All rights reserved.