我需要一种从FileStream
每个字符中读取的方法。逐个字符。每次我读取一个字符时,我都需要增加FileStream.Position
.
我正在尝试代码片段,但它返回多个字符:
Dim bytes(1) As Byte
Dim nBytes As Integer = oFile.Read(bytes, 0, bytes.Length)
Dim nChars As Integer = decoder8.GetCharCount(bytes, 0, nBytes)
Dim chars(nChars - 1) As Char
nChars = decoder8.GetChars(bytes, 0, nBytes, chars, 0)
Return New String(chars, 0, nChars)