Code example for Hashtable

Methods: containsKey, get, put

0
				if (neededBytes > remaining - 2) {
					if (D) Log.w(getDriverName(), "Got " + (remaining - 2) + " bytes for report " + data[offset + 1] + ", but need " + neededBytes);
					return remaining;
				} 
				 
				if (!m_readBuffers.containsKey(neededBytes))
					m_readBuffers.put(neededBytes, new byte[neededBytes]);
				 
				byte[] buffer = m_readBuffers.get(neededBytes);
				System.arraycopy(data, offset + 2, buffer, 0, neededBytes);
				 
				try { 
					handleHIDMessage(data[offset], data[offset + 1], buffer);
				} catch (Exception ex) {
					Log.e(getDriverName(), "Handling HID message " + data[offset + 1] + " failed: " + ex.toString());
				} 
			} 
			else 
			{ 
				if (D) Log.w(getDriverName(), "Got an unsupported HID report: " + data[offset + 1] + ", length: " + (remaining - 2));
			}