-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
32 lines (29 loc) · 857 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace winfileio
{
class Program
{
static void Main(string[] args)
{
string file = @"copy.mkv";
string rewrite = @"copied.mkv";
byte[] wfioBlocks = new byte[WinFileIO.BlockSize];
using (WinFileIO writer = new WinFileIO(wfioBlocks))
using (WinFileIO reader = new WinFileIO(wfioBlocks))
{
reader.OpenForReading(file);
writer.OpenForWriting(rewrite);
while (reader.Position < reader.Length)
{
int read = reader.ReadBlocks(wfioBlocks.Length);
writer.WriteBlocks(read);
}
}
}
}
}