Returns the next byte from an input stream without removing it from the stream.
...steamreader_object.Peek()
Prerequisites
The input stream must have been opened using a New to create the streamreader_object.
Parameters
None
Remarks
This method returns the next byte from the input stream as an Integer, but it does not remove the byte from the stream. The next input method call will still return this byte.
If any I/O error occurs or an end-of-file is encountered, this method returns -1.
For serial devices, this method does not block, but immediately returns -1 if no bytes are available to read.
If no device or file is open, this method throws an Exception.
Examples
Dim com1 As New StreamReader("/dev/com1")
Dim c As Integer
c = com1.Peek()
See Also