© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
25 replies
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
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 ?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ creating a word file
C#CC# / help
4y ago
System.NotSupportedException: Collection was of a fixed size.
C#CC# / help
2y ago
Reduce File Size
C#CC# / help
2y ago
MemoryMarshal.Cast on a struct with array of known fixed size
C#CC# / help
2y ago