Dear All ,
The question is quite simple for all of you . I have a binary file . A description for this file says that :
"first 2 bytes in the header is the number of records"
I have opened this file and loaded it into bytes by this function
Public Shared Function ReadBinaryData(ByVal path As String) As Byte() ' Open the binary file. Dim streamBinary As New FileStream(path, FileMode.Open) ' Create a binary stream reader object. Dim readerInput As BinaryReader = New BinaryReader(streamBinary) ' Determine the number of bytes to read. Dim lengthFile As Integer = FileSize(path) ' Read the data in a byte array buffer. Dim inputData As Byte() = readerInput.ReadBytes(lengthFile) ' Close the file. streamBinary.Close() readerInput.Close() Return inputData End Function 'ReadBinaryData'
I need now to understand how to read the first 2 bytes and convert them to number.