Code example for TimeoutException

0
		 
		try { 
			wait(5000);
			if (!m_bMsgReceived) {
				// TODO error, no answer received 
				throw new TimeoutException("No answer received");
			} else { 
				m_bMsgReceived = false;
				 
				buffer = new byte[m_nRxBytes];
				 
				System.arraycopy(m_rgRxBuffer, 0, buffer, 0, m_nRxBytes);
 
				Arrays.fill(m_rgRxBuffer, (byte)0);
				m_nRxBytes = 0;
			} 
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		}