sftp 下载实现

使用零拷贝技术优化合并分块的功能
This commit is contained in:
laoyuyu
2020-01-15 20:28:10 +08:00
parent 6f53235807
commit 50b265f22a
37 changed files with 934 additions and 257 deletions

View File

@@ -67,7 +67,7 @@ public final class HttpRecordHandler extends RecordHandler {
tr.startLocation = startL;
tr.isComplete = false;
tr.threadType = getEntity().getTaskType();
tr.threadType = record.taskType;
//最后一个线程的结束位置即为文件的总长度
if (threadId == (record.threadNum - 1)) {
endL = getFileSize();
@@ -90,7 +90,7 @@ public final class HttpRecordHandler extends RecordHandler {
} else {
record.isBlock = false;
}
record.taskType = getEntity().getTaskType();
record.taskType = requestType;
record.isGroupRecord = getEntity().isGroupChild();
if (record.isGroupRecord) {
if (getEntity() instanceof DownloadEntity) {