Code example for UsbEndpoint

Methods: getMaxPacketSize

0
				int writeTmoutMs
				) { 
			mUsbConnection = connection;
			mUsbEndpoint = bulkInEndpoint;
			mTimeout = writeTmoutMs;
			rcvPkt = new byte[mUsbEndpoint.getMaxPacketSize()];
		} 
 
		public UsbSerialInputStream(UsbDeviceConnection connection,
				UsbEndpoint bulkOutEndpoint) {
			this(connection, bulkOutEndpoint, DEFAULT_READ_TIMEOUT_MS);
		} 
 
		@Override 
		public int read() throws IOException { 
			synchronized(this) {
				int rcvd = read(rcvPkt, 0, 1);
				if (rcvd == 0) throw new IOException("timeout");
				return rcvPkt[0] & 0xff;
			} 
Experience pair programming with AI  Get Codota for Java