Hi everyone,
I have a seemingly simple problem which has been driving me crazy. I have a file consisting of a number of bytes and I want to take out eight bytes at a time, combine all eight bytes into a string, convert the new string to decimal and output the decimal to a text file. Here is my code that I've been working with:
Here s1 is my filestream reader and s2 is my filestream writer. So far this prints out to the writer file the same thing as the reader file. I am not familiar with working with bytes and this has been driving me crazy. Can someone please help me out. Thanks!
I have a seemingly simple problem which has been driving me crazy. I have a file consisting of a number of bytes and I want to take out eight bytes at a time, combine all eight bytes into a string, convert the new string to decimal and output the decimal to a text file. Here is my code that I've been working with:
VB.NET:
Dim index As Integer = 8
For i = 0 To s1.Length() - 1
bytes(i) = s1.ReadByte
If (i < index) Then
s2.WriteByte(bytes(i))
End If
index = index + 8
Next
Here s1 is my filestream reader and s2 is my filestream writer. So far this prints out to the writer file the same thing as the reader file. I am not familiar with working with bytes and this has been driving me crazy. Can someone please help me out. Thanks!