C#C
C#4y ago
Surihia

Creating a file with a fixed size

I am writing a video splitter app for my personal storage and would like some help.

What my app does is split a video file into multiple tiny files. I will call each tiny file a piece here.
The issue I am facing is creating a new file piece with a custom size. I want to specify a size value for a piece and that size value is given via a argument.
Here is a rough example of my argument:
videofile.mp4, 50, pieceName

I can create a new file with a filestream, and open the video in another filestream. but the fs.CopyTo() method doesn't have a parameter to copy an x amount of bytes and so I can't tell it to copy 50 bytes of data from one filestream to another filestream.

How do I handle this problem ?
Was this page helpful?