c# split large file into chunks
C#
public static void SplitFile(string inputFile, int chunkSize, string path)
{
const int BUFFER_SIZE = 20 * 1024;
byte[] buffer = new byte[BUFFER_SIZE];
using (Stream input = File.OpenRead(inputFile))
{
int index = 0;
while (input.Position < input.Length)
{
using (Stream output = File.Create(path + "\\" + index))
{
int remaining = chunkSize, bytesRead;
while (remaining > 0 && (bytesRead = input.Read(buffer, 0,
Math.Min(remaining, BUFFER_SIZE))) > 0)
{
output.Write(buffer, 0, bytesRead);
remaining -= bytesRead;
}
}
index++;
Thread.Sleep(500); // experimental; perhaps try it
}
}
}
Also in C#:
- Title
- c# regex to find number between parenthesis
- Category
- C#
- Title
- c# trim string
- Category
- C#
- Title
- unity how to end a game with esc
- Category
- C#
- Title
- c# integer to bit string
- Category
- C#
- Title
- unity try get component
- Category
- C#
- Title
- c# query string builder
- Category
- C#
- Title
- countdown script in unity
- Category
- C#
- Title
- wpf c# select folder path
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- linq c# where condition
- Category
- C#
- Title
- No context type was found in the assembly
- Category
- C#
- Title
- c# replace foreach with lambda
- Category
- C#
- Title
- c# float to string
- Category
- C#
- Title
- button color uwp c#
- Category
- C#
- Title
- c# inline initialize dictionary
- Category
- C#
- Title
- while loop c#
- Category
- C#
- Title
- unity custom editor save changes
- Category
- C#
- Title
- optional parameter get request c#
- Category
- C#
- Title
- jumping with character controller unity
- Category
- C#
- Title
- how to add an embedded resource in visual studio code
- Category
- C#
- Title
- c# tostring mmm dd yyyy
- Category
- C#
- Title
- c# string to float
- Category
- C#
- Title
- unity to integer
- Category
- C#
- Title
- asp net identity include phone number when registering
- Category
- C#
- Title
- parse strings into words C#
- Category
- C#
- Title
- how to get odd saturday in a month in c#
- Category
- C#
- Title
- why is c# say ; expected
- Category
- C#
- Title
- how to trim path in C#
- Category
- C#
- Title
- bundle.config in mvc is missing
- Category
- C#
- Title
- c# merge two lists as queryable
- Category
- C#
- Title
- round vector3 unity
- Category
- C#
- Title
- delay in unity
- Category
- C#
- Title
- c# linq select from object list
- Category
- C#
- Title
- wpf binding object get value
- Category
- C#
- Title
- install .net sdk ubuntu 20
- Category
- C#
- Title
- c# input integer
- Category
- C#
- Title
- c# remove specific character from string
- Category
- C#
- Title
- how to make pressing enter an event in c#
- Category
- C#
- Title
- array to list C
- Category
- C#
- Title
- c# get full URL of page
- Category
- C#
- Title
- iteration c#
- Category
- C#
- Title
- how to start an if statement in c#
- Category
- C#
- Title
- c# throw new exception
- Category
- C#
- Title
- unity change text color
- Category
- C#
- Title
- unity deactivate scripts in list
- Category
- C#
- Title
- c# convert column name to number
- Category
- C#
- Title
- c# storing value in session
- Category
- C#
- Title
- perlin noise unity
- Category
- C#
- Title
- get set c#
- Category
- C#
- Title
- change sprite of gameobject unity
- Category
- C#
- Title
- zip file ignoring directory starting with dot
- Category
- C#
- Title
- c# find element by condition
- Category
- C#
- Title
- c# getter setter
- Category
- C#
- Title
- c# windows grab screenshot
- Category
- C#
- Title
- unity next scene
- Category
- C#
- Title
- c# print
- Category
- C#
- Title
- c# how to use inovke
- Category
- C#
- Title
- mvc c# w3schools
- Category
- C#
- Title
- onmouseclick unity
- Category
- C#
- Title
- mvc write to console
- Category
- C#
- Title
- C# type cast float to string
- Category
- C#
- Title
- c# how to check if two lists have same values
- Category
- C#
- Title
- c# print to console
- Category
- C#
- Title
- c# filesystemwatcher double events
- Category
- C#
- Title
- mongodb custom IIdGenerator
- Category
- C#
- Title
- unity docs player input
- Category
- C#
- Title
- c# md5 hash file
- Category
- C#
- Title
- unity persistent data
- Category
- C#
- Title
- radians to degree c#
- Category
- C#
- Title
- Unity if object doens't exist
- Category
- C#
- Title
- create expression func c# for use in where clause
- Category
- C#
- Title
- uwp roaming data sample
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- c# type of generic is string
- Category
- C#
- Title
- unity load scene
- Category
- C#
- Title
- month number to text in c#
- Category
- C#
- Title
- how to put double quotes in a string c#
- Category
- C#
- Title
- null coalesce ternary c#
- Category
- C#
- Title
- set int to null c#
- Category
- C#
- Title
- traversing an enum c#
- Category
- C#
- Title
- C# function return datareader
- Category
- C#
- Title
- c# size of enum
- Category
- C#
- Title
- select a whole row out of a 2d array C#
- Category
- C#
- Title
- unity quaternion
- Category
- C#
- Title
- unity timer
- Category
- C#
- Title
- windows form rounded corners
- Category
- C#
- Title
- c# while loop
- Category
- C#
- Title
- wpf textblock line break code behind
- Category
- C#
- Title
- c# class to byte array
- Category
- C#
- Title
- c# input
- Category
- C#
- Title
- how to use more than one condition in ef join
- Category
- C#
- Title
- windows forms iterate through all controls
- Category
- C#
- Title
- wpf binding ancestor codebehind
- Category
- C#
- Title
- unity rotate object c#
- Category
- C#
- Title
- unity set sprite transparency
- Category
- C#
- Title
- new command - latex
- Category
- C#
- Title
- c# listview
- Category
- C#
- Title
- chase object unity
- Category
- C#
- Title
- c# dictionary literal initializer
- Category
- C#
- Title
- c# read all text from a file
- Category
- C#