Click or drag to resize

PipeStreamWrite Method

Writes a specified number of bytes to the USB device.

Namespace:  WinUsbNet
Assembly:  WinUsbNet (in WinUsbNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public override void Write(
	byte[] buffer,
	int offset,
	int count
)

Parameters

buffer
Type: SystemByte
An array of bytes containing the data to write to the USB device.
offset
Type: SystemInt32
The zero-based offset in the buffer at which to begin sending data to the USB device.
count
Type: SystemInt32
The number of bytes to write to the USB device.
Exceptions
ExceptionCondition
NotSupportedExceptionThe PipeStream does not support writing.
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeExceptionoffset or count is negative.
ArgumentExceptionThe sum of offset and count is larger than the buffer length.
Win32ExceptionAn error was reported by the operating system.
IOExceptionThe UsbDevice is not open, or the transfer did not complete.
Remarks
If the number of bytes written to the USB device is a multiple of the maximum packet size, and the WriteUseShortPacket property is set to true, then a zero-length packet will be sent after the data.
See Also