 | 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)
Syntaxpublic override void Write(
byte[] buffer,
int offset,
int count
)
Public Overrides Sub Write (
buffer As Byte(),
offset As Integer,
count As Integer
)
public:
virtual void Write(
array<unsigned char>^ buffer,
int offset,
int count
) override
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.
ExceptionsException | Condition |
---|
NotSupportedException | The PipeStream
does not support writing. |
ArgumentNullException | buffer is null.
|
ArgumentOutOfRangeException | offset or
count is negative. |
ArgumentException | The sum of offset and
count is larger than the buffer length. |
Win32Exception | An error was reported by
the operating system. |
IOException | The 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