 | PipeStreamReadByte Method |
Attempts to read one byte from the USB device.
Namespace:
WinUsbNet
Assembly:
WinUsbNet (in WinUsbNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic override int ReadByte()
Public Overrides Function ReadByte As Integer
public:
virtual int ReadByte() override
Return Value
Type:
Int32The unsigned byte cast to an Int32, or -1 if a short packet is received and the
ReadUseShortPacket property is set to true.
ExceptionsException | Condition |
---|
IOException | The UsbDevice is not open. |
NotSupportedException | The PipeStream
does not support reading. |
Win32Exception | An error was reported by
the operating system. If NativeErrorCode is 0x00000079,
the operation timed out. |
Remarks
If the USB device returns more data than requested, the excess
data will be stored in an internal buffer. Future calls to
Read or
ReadByte
will read from the internal buffer until it is exhausted.
See Also