Here's the byte writer for C#:
PHP Code:
System.IO.FileStream fs = System.IO.File.Create("filename", 1024) // 1024 is the byte limit
Hopefully that helps!

I'm pretty sure that C# also has another type of writer that will let you write it line by line. You'd probably want to double check on that...