The Transferring of Files through Awesomeness and Unicorn Space Pt. 1

Hi all! I thought we should jump right into this and start off with a little discussion about how transferring a file works. It’s fairly simple in concept, you get the file name and use that to find the file. You read the file bytes into a byte array and then you send the file name and the byte array to where ever you decide to send it, for example a server you have setup or a P2P transfer. On the side you sent it you would read  the file name, create a new file with that name, and then write the bytes out to that file which recreates the file more or less on this side. It sounds pretty simple right? I’ve found out that regardless of how simple it sounds it can get a little more complex when programming it. I recommend starting in C# just because it has a lot of handy features that you can use to read in the file bytes and create the file. Now I’m going to talk about a few things wrong with what we just agreed was a pretty decent explanation of transferring a file. A byte array can’t hold a file that is greater then 2 gigabytes so if your not working with anything that large you can store the whole file in one byte array without much problem. There is a size limit imposed by Microsoft’s CLR which happens to be 2 gigabytes. The max size for an array is, if i’m not mistaken,  2,147,483,647 which is the max size for an int 32. So now your probably asking well Aaron how do i transfer a file over 2 GB well I’ll tell you. Next Post.