Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.WriteLine("read file in calc in");
- int dc = 0, lastCounts = 0;
- if (fsLenght % 104857500 == 0)
- dc = (int)((long)(fsLenght / 104857500));
- else
- {
- dc = (int)((long)(fsLenght / 104857500));
- lastCounts = (int)((long)(fsLenght - 104857500 * dc));
- }
- Console.WriteLine("calc out, packs = " + (dc + 1));
- long index = 0;
- for (int i = 0; i < dc + 1; i++)
- {
- Console.WriteLine("for in");
- if (i != dc)
- {
- Console.WriteLine((i + 1) + "pack in");
- byte[] bytes = new byte[104857500];
- using (FileStream fs = new FileStream(@filePath, FileMode.Open, FileAccess.Read))
- {
- if (fs.CanSeek)
- {
- index += 104857500;
- fs.Seek(index, SeekOrigin.Begin);
- fs.Read(bytes, 0, bytes.Length);
- BC bC = new BC();
- c = bC;
- using (FileStream filestream = new FileStream(@folderPath + "\\cfile.nen", FileMode.Append, FileAccess.Write))
- {
- if (filestream.CanSeek)
- {
- filestream.Seek(index, SeekOrigin.Begin);
- filestream.Write(c.En(mood, _key, bytes), 0, 104857500);
- bytes = null;
- filestream.Close();
- }
- }
- }
- fs.Close();
- }
- Console.WriteLine((i + 1) + "pack out");
- }
- else
- {
- Console.WriteLine((i + 1) + "pack in");
- byte[] bytes = new byte[lastCounts];
- using (FileStream fs = new FileStream(@filePath, FileMode.Open, FileAccess.Read))
- {
- if (fs.CanSeek)
- {
- index += 104857500;
- fs.Seek(index, SeekOrigin.Begin);
- fs.Read(bytes, 0, lastCounts);
- fs.Close();
- using (FileStream filestream = new FileStream(@folderPath + "\\cfile.nen", FileMode.Append, FileAccess.Write))
- {
- char[] splitter = { '\\' };
- string[] dir = filePath.Split(splitter);
- byte[] format = Encoding.UTF8.GetBytes("*|f*4-sy7d" + dir[dir.Length - 1]);
- byte[] array = new byte[bytes.Length + format.Length];
- for (int a = 0, s = 0; a < array.Length; a++)
- {
- if (a < bytes.Length)
- {
- array[a] = bytes[a];
- }
- else
- {
- array[a] = format[s];
- s++;
- }
- }
- bytes = null;
- BC bC = new BC();
- c = bC;
- if (filestream.CanSeek)
- {
- filestream.Seek(index, SeekOrigin.Begin);
- filestream.Write(c.En(mood, _key, array), 0, array.Length);
- array = null;
- filestream.Close();
- }
- }
- }
- }
- Console.WriteLine((i + 1) + "pack out");
- }
- Console.WriteLine("for out");
- }
- Console.WriteLine("read file out");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement