I would like to write the contents of a short array using the filestream writer for a byte array. I would like to do this to increase the speed I can write the array (am doing "real time" vb.net) Does anyone know how to cast the short array to byte array, or ANY method to get this to work?
Thanks,
Dale
Sub main()
Dim fo As New FileInfo("e:\dbtest.bin")
Dim fs As FileStream = f
penWrite
Dim nBytes As Integer
Dim ByteArray(10) As Byte
Dim SArray(10) As Short
Dim ii As Short
Dim bb As Byte
bb = 0
For ii = 0 To 10
SArray(ii) = ii
ByteArray(ii) = bb
bb += 1
Next ii
nBytes = ByteArray.Length
fs.Write(ByteArray, 0, nBytes)
' Would like to comment out the above 2 lines
' and include 2 following lines
'nBytes = SArray.Length
'fs.Write(SArray, 0, nBytes)
End Sub
Thanks,
Dale
Sub main()
Dim fo As New FileInfo("e:\dbtest.bin")
Dim fs As FileStream = f
Dim nBytes As Integer
Dim ByteArray(10) As Byte
Dim SArray(10) As Short
Dim ii As Short
Dim bb As Byte
bb = 0
For ii = 0 To 10
SArray(ii) = ii
ByteArray(ii) = bb
bb += 1
Next ii
nBytes = ByteArray.Length
fs.Write(ByteArray, 0, nBytes)
' Would like to comment out the above 2 lines
' and include 2 following lines
'nBytes = SArray.Length
'fs.Write(SArray, 0, nBytes)
End Sub