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

Hi all! A quick recap of what we discussed last time. We talked about how to transfer a file and why that method wouldn’t work with files over 2 gigabytes. Now i’m going to tell you how to transfer a file over 2 gigabytes in theory. Since we can’t hold all the file bytes of, lets say a 3 GB file, what we would need to do is to send a chunk of the bytes one at a time. The size of the chunk is really up to you I chose 1024 * 5000, which is about 5 megabytes, as long as it doesn’t go over 2 gigabytes it will be fine. You would do the same as before except that you would loop over reading in the bytes and sending them until there are no more bytes to read in from the file. The side you are sending it to would keep writing bytes to the file until they’ve gotten the last chunk from you and then they should have the whole file. Some things you have to watch out for if your doing this in C# is when your reading in bytes you have to tell it how many to read in. Now you can have it always read in the chunk size and then write that to the file. That is a bad idea because you’ll write junk bytes to your file which will then corrupt it and it will not open properly, if at all. You have to make sure some how that the number of bytes sent is the same number you receive and write, that way you won’t get any junk bytes written to your file. I’m not sure if I will actually go and explain a little bit of code but we’ll see if I am feeling up to it. One thing before I leave you. I found this awesome emote (╯°□°)╯︵ ┻━┻ That’s all have a great week everyone.