T - the type of resultpublic interface DownloadSession<T>
A session will be created when the download task begins, and be destroyed
when the download completes or fails. Once the download session created, one
of the following methods completed(), failed() must be
invoked.
| Modifier and Type | Method and Description |
|---|---|
T |
completed()
Calls when all the data has been received successfully.
|
void |
failed()
Calls when an error occurs during downloading.
|
void |
receiveData(ByteBuffer data)
Calls when receives a part of data.
|
void receiveData(ByteBuffer data) throws IOException
data - the dataIOException - if an I/O error occursT completed() throws Exception
Notes for implementation: In this method you should close the opened resources.
Exception - if an I/O error occursCopyright © 2016. All rights reserved.