Click or drag to resize

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)
Syntax
public override int ReadByte()

Return Value

Type: Int32

The unsigned byte cast to an Int32, or -1 if a short packet is received and the ReadUseShortPacket property is set to true.

Exceptions
ExceptionCondition
IOExceptionThe UsbDevice is not open.
NotSupportedExceptionThe PipeStream does not support reading.
Win32ExceptionAn 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