Hi,
Thanks for your post. As I understand, you have some performance concerns
about the Reader class. I'd like to share the following information with
you:
What's the Reader class you are using?
Generally speaking, the Peek method of Reader classes (say, StreamReader,
etc) will return the next available character. That is, it should be of the
same with the PeekByte you suggested.
In addition, please kindly note that the FileStream has buffering
internally to improve read and write performance. A buffer is a block of
bytes in memory used to cache data, thereby reducing the number of calls to
the operating system. A call to .Read after a .Peek call will get data from
the cache, so I believe there is no need to worry about the performance.
Please feel free to let me know if you have any problems or concerns.
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! --
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.