UsbAccessoryStreamTransportpublic class UsbAccessoryStreamTransport extends com.android.accessorydisplay.common.Transport Sends or receives messages over a file descriptor associated with a {@link UsbAccessory}. |
Fields Summary |
---|
private android.os.ParcelFileDescriptor | mFd | private FileInputStream | mInputStream | private FileOutputStream | mOutputStream |
Methods Summary |
---|
protected void | ioClose()
try {
mFd.close();
} catch (IOException ex) {
}
mFd = null;
mInputStream = null;
mOutputStream = null;
| protected int | ioRead(byte[] buffer, int offset, int count)
if (mInputStream == null) {
throw new IOException("Stream was closed.");
}
return mInputStream.read(buffer, offset, count);
| protected void | ioWrite(byte[] buffer, int offset, int count)
if (mOutputStream == null) {
throw new IOException("Stream was closed.");
}
mOutputStream.write(buffer, offset, count);
|
|