Share via


UsbManager.OpenAccessoryInputStream(UsbAccessory) Method

Definition

Opens an input stream for reading from the USB accessory.

[Android.Runtime.Register("openAccessoryInputStream", "(Landroid/hardware/usb/UsbAccessory;)Ljava/io/InputStream;", "GetOpenAccessoryInputStream_Landroid_hardware_usb_UsbAccessory_Handler", ApiSince=36)]
public virtual System.IO.Stream OpenAccessoryInputStream(Android.Hardware.Usb.UsbAccessory accessory);
[<Android.Runtime.Register("openAccessoryInputStream", "(Landroid/hardware/usb/UsbAccessory;)Ljava/io/InputStream;", "GetOpenAccessoryInputStream_Landroid_hardware_usb_UsbAccessory_Handler", ApiSince=36)>]
abstract member OpenAccessoryInputStream : Android.Hardware.Usb.UsbAccessory -> System.IO.Stream
override this.OpenAccessoryInputStream : Android.Hardware.Usb.UsbAccessory -> System.IO.Stream

Parameters

accessory
UsbAccessory

the USB accessory to open an input stream for

Returns

input stream to read from given USB accessory

Attributes

Remarks

Opens an input stream for reading from the USB accessory. If accessory is not open at this point, accessory will first be opened.

If data is read from the created java.io.InputStream all data of a USB transfer should be read at once. If only a partial request is read, the rest of the transfer is dropped.

The caller is responsible for ensuring that the returned stream is closed.

Java documentation for android.hardware.usb.UsbManager.openAccessoryInputStream(android.hardware.usb.UsbAccessory).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to