segmented copy file (for network file transfer resume)
来源:互联网 发布:oracle数据库笔试题 编辑:程序博客网 时间:2024/06/06 08:31
private long SectionedCopy(string srcFile, long startPos, string dstFile, bool sectioned)
{
byte[] buffer = new byte[1024];
int bytesRead = 0;
long savedBytes = startPos;
long fileSize = new FileInfo(srcFile).Length;
if (startPos >= fileSize)
return fileSize;
using (FileStream fsInput = new FileStream(srcFile, FileMode.Open, FileAccess.Read))
{
using(FileStream fsOutput = new FileStream(dstFile, FileMode.Append, FileAccess.Write))
{
fsInput.Seek(startPos, SeekOrigin.Begin);
while (savedBytes < fileSize)
{
bytesRead = fsInput.Read(buffer, 0, buffer.Length);
fsOutput.Write(buffer, 0, bytesRead);
savedBytes += bytesRead;
}
}
}
return savedBytes;
}
}
- segmented copy file (for network file transfer resume)
- Network File Copy using SSH
- Spring MVC大文件的断点续传(File Transfer Resume)
- Managed File Transfer and Network Solutions
- File Transfer
- File Transfer
- File Transfer
- File Transfer
- File Transfer
- COPY FILE
- copy file
- Copy file
- copy file
- copy file
- copy file
- maven Failed to copy file for artifact
- maven Failed to copy file for artifact
- RFC959 - File Transfer Protocol
- Java开发工具大全[3]
- do not bind 127_0_0_1 in socket server
- Java开发工具大全[4]
- 胡说设计模式
- JTDS连接错误java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.lib
- segmented copy file (for network file transfer resume)
- MyEclipse下设置合适的Content Assist快捷键
- Get datepart
- 创建用于自定义SharePiont解决方案的Visual Studio项目
- Java开发工具大全[5]
- CDECL 调用函数内。获得参数个数。
- 人物:22年前的天才程序员,今天在干什么?
- C#委托,事件理解入门 (译稿)
- Java开发工具大全[6]