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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user