Code example for BasicHttpParams

0
 
	private Util() { 
	} 
 
	public static HttpParams getTimeoutHttpParams() {
		HttpParams params = new BasicHttpParams();
		HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIMEOUT);
		HttpConnectionParams.setSoTimeout(params, SOCKET_TIMEOUT);
		return params;
	} 
 
	public static void closeStream(Closeable stream) {
		if (stream != null) {
			try { 
				stream.close();
				stream = null;
			} catch (IOException e) {
				Log.w(TAG, "Close stream exception", e);
			} 
		} 
	}