Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim binReader As New BinaryReader(File.Open(fileName, FileMode.Open))
Try
Dim b As Byte
While(True)
b = binReader.ReadByte
' Do something with the byte
Wend
Catch ex As EndOfStreamException
End Try
Dim MyByte As Byte
Dim s As String = ""
Dim bitset As Boolean
For a As Integer = 7 To 0 Step -1
bitset = (MyByte And CByte(Math.Pow(2, a))) = CByte(Math.Pow(2, a))
If bitset Then
s += "1"
Else
s += "0"
End If
Dim ResultByte As Byte
Dim StringBit As Byte
'assumes the following is within a while not end of file loop
ResultByte = 0
For a As Integer = 7 To 0 Step -1
'read a byte from input file into StringBit
StringBit -=48
ResultByte += StringBit * CByte(Math.Pow(2,a))
Next a
'write the byte ResultByte to the output file
That is close to what I needed but it is returning numbers other than 0 and 1 it is returning numbers like 80, 124, 86, etc.