Thursday, March 26, 2009

Save a byte array to a file

I've done this before and always seem to forget about it..  Found this here

How to save a byte array to a file in Visual Basic .NET
        Dim byteData() As Byte

' Create a file and write the byte data to a file.
Dim oFileStream As System.IO.FileStream
oFileStream = New System.IO.FileStream("bytes.dat", System.IO.FileMode.Create)
oFileStream.Write(byteData, 0, byteData.Length)

No comments: