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 http://www.example-code.com/vbdotnet/save-byte-array.asp

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)
oFileStream.Close()



No comments: