M
Michael_R_Banks
I'm getting erroneous data from subsequent calls to ReadInt32 -- I
have my FileStream and BinaryReader set up & accessing my binary
file. When I try to read the first 150 Int32's into an array using a
For-loop, the first read is a success (correct value), but then on the
next loop, the second call to ReadInt32 returns the same value as the
first read & the rest of the data is off also. Any ideas what I'm
doing wrong?
Loop: %%%%%%%%%%%%%%%%%%%%%%%
Dim Joints as New ArrayList
Dim j As Integer
Dim ARY As New MeasurementRecord
Dim tempvalue As Int32
For j = 0 To ((B_File.BaseStream.Length * 8) / 32) - 1
ARY.Clear()
For index = 0 To 149
tempvalue = B_File.ReadInt32
ARY.AddValue(index, tempvalue)
variablecount += 1
j += 1
Next index
Joints.Add(ARY)
Next
Class: %%%%%%%%%%%%%%%%%%%%%%%
Public Class MeasurementRecord
Dim classarray(149) As Int32
Public Sub AddValue(ByVal index As Integer, ByVal value As Int32)
classarray(index) = value
End Sub
Public Function Retreive(ByVal index As Integer) As Int32
Return classarray(index)
End Function
Public Sub Clear()
Dim index As Integer
For index = 0 To 149
classarray(index) = 0
Next
End Sub
End Class
Binary: %%%%%%%%%%%%%%%%%%%%%%%
0000 0001 0000 0000 0000 0000 0000 0000
0000 0004 0000 0029 0000 0000 0000 0000
0000 001D 0000 003D 0000 0000 0000 0000
have my FileStream and BinaryReader set up & accessing my binary
file. When I try to read the first 150 Int32's into an array using a
For-loop, the first read is a success (correct value), but then on the
next loop, the second call to ReadInt32 returns the same value as the
first read & the rest of the data is off also. Any ideas what I'm
doing wrong?
Loop: %%%%%%%%%%%%%%%%%%%%%%%
Dim Joints as New ArrayList
Dim j As Integer
Dim ARY As New MeasurementRecord
Dim tempvalue As Int32
For j = 0 To ((B_File.BaseStream.Length * 8) / 32) - 1
ARY.Clear()
For index = 0 To 149
tempvalue = B_File.ReadInt32
ARY.AddValue(index, tempvalue)
variablecount += 1
j += 1
Next index
Joints.Add(ARY)
Next
Class: %%%%%%%%%%%%%%%%%%%%%%%
Public Class MeasurementRecord
Dim classarray(149) As Int32
Public Sub AddValue(ByVal index As Integer, ByVal value As Int32)
classarray(index) = value
End Sub
Public Function Retreive(ByVal index As Integer) As Int32
Return classarray(index)
End Function
Public Sub Clear()
Dim index As Integer
For index = 0 To 149
classarray(index) = 0
Next
End Sub
End Class
Binary: %%%%%%%%%%%%%%%%%%%%%%%
0000 0001 0000 0000 0000 0000 0000 0000
0000 0004 0000 0029 0000 0000 0000 0000
0000 001D 0000 003D 0000 0000 0000 0000