Create a File from a Byte Array

Need to write a byte array to a file? .NET’s got your back with File.WriteAllBytes.


var bytes = GetSomeBytes();
File.WriteAllBytes(@"c:\temp\somefile.tmp", bytes);

Author: Adam Prescott

I'm enthusiastic and passionate about creating intuitive, great-looking software. I strive to find the simplest solutions to complex problems, and I embrace agile principles and test-driven development.

Leave a comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: