Code example for TimeoutException

0
		} catch (InterruptedException e) {
			if (D) Log.e(TAG, "" + System.currentTimeMillis() + " readLine() interrupted: " + e);
		} 
		if (line == null) {
			if (D) Log.d(TAG, "" + System.currentTimeMillis() + " readLine() timeout");
			throw new TimeoutException(null);
		} 
		if (D) Log.d(TAG, "" + System.currentTimeMillis() + " readLine (" + line.length() + "): " + line);
		return line;
	} 
 
	public void writeLine(String line) throws IOException {
		line += "\r";
		if (D) Log.d(TAG, "" + System.currentTimeMillis() + " writeLine: " + line);
		mOut.write(myGetBytes(line));
		mOut.flush();
	} 
 
	public String chat(String send, String expect, long timeout) throws IOException, TimeoutException {
		StringBuilder result = new StringBuilder();
		writeLine(send);