1
0
mirror of https://github.com/Rogiel/httpchannel synced 2025-12-06 07:32:50 +00:00

Implements SeekableDownloadChannel

The SeekableDownloadChannel implements SeekableByteChannel and allows to
set the position of the channel and read data from that point onward.
The SeekableDownloadChannel implementation, creates a new internal
DownloadChannel at every call to position(long), that will create a
resume channel onto that point, thus, not all service implementations
are supported.
This commit is contained in:
2012-01-17 23:11:03 -02:00
parent ff4abca387
commit a4c569f10e
29 changed files with 581 additions and 61 deletions

View File

@@ -93,11 +93,13 @@ public class ChannelCopy implements Callable<List<URI>> {
*
* @param downloadChannel
* the download channel
* @throws IOException
* if any {@link IOException} occur
*/
public ChannelCopy(DownloadChannel downloadChannel) {
public ChannelCopy(DownloadChannel downloadChannel) throws IOException {
this.downloadChannel = downloadChannel;
this.filename = downloadChannel.getFilename();
this.filesize = downloadChannel.getFilesize();
this.filename = downloadChannel.filename();
this.filesize = downloadChannel.size();
}
/**
@@ -128,8 +130,8 @@ public class ChannelCopy implements Callable<List<URI>> {
.openChannel();
this.downloadChannel = downloadChannel;
this.filename = downloadChannel.getFilename();
this.filesize = downloadChannel.getFilesize();
this.filename = downloadChannel.filename();
this.filesize = downloadChannel.size();
}
/**