Why does the following code produce a string ("Byte me!") in the output
file, rather than byte data as integers (66 121 116 101 32 109 101 33)?
Dim fs As System.IO.FileS tream = System.IO.File. Open("C:\myMess age.dat",
IO.FileMode.Cre ate)
Dim msg As String = "Byte me!"
Dim msgByteArray() As Byte = System.Text.Enc oding.Default.G etBytes(msg)
fs.Write(msgByt eArray, 0, msgByteArray.Le ngth)
....And, how do I get the output file to have the byte array data?
PS - I know I could use a different Stream type, but I want to do this using
a FileStream.
file, rather than byte data as integers (66 121 116 101 32 109 101 33)?
Dim fs As System.IO.FileS tream = System.IO.File. Open("C:\myMess age.dat",
IO.FileMode.Cre ate)
Dim msg As String = "Byte me!"
Dim msgByteArray() As Byte = System.Text.Enc oding.Default.G etBytes(msg)
fs.Write(msgByt eArray, 0, msgByteArray.Le ngth)
....And, how do I get the output file to have the byte array data?
PS - I know I could use a different Stream type, but I want to do this using
a FileStream.
Comment