<T> T call() throws IOException {
		if (shouldMock()) {
			// ce générique doit être conservé pour la compilation javac en intégration continue
			return this.createMockResultOfCall();
		}
		final long start = System.currentTimeMillis();
		int dataLength = -1;
		try {
			final URLConnection connection = openConnection();
			// pour traductions (si on vient de CollectorServlet.forwardActionAndUpdateData,
			// cela permet d'avoir les messages dans la bonne langue)
			connection.setRequestProperty("Accept-Language", I18N.getCurrentLocale().getLanguage());

			// Rq: on ne gère pas ici les éventuels cookie de session http,
			// puisque le filtre de monitoring n'est pas censé créer des sessions
			//		if (cookie != null) { connection.setRequestProperty("Cookie", cookie); }

			connection.connect();

			//		final String setCookie = connection.getHeaderField("Set-Cookie");
			//		if (setCookie != null) { cookie = setCookie; }

			final CounterInputStream counterInputStream = new CounterInputStream(
					connection.getInputStream());

			final T result;
			try {
				@SuppressWarnings("unchecked")
				final T tmp = (T) read(connection, counterInputStream);
				result = tmp;
			} finally {
				counterInputStream.close();
				dataLength = counterInputStream.getDataLength();
			}
			LOG.debug("read on " + url + " : " + result);

			if (result instanceof RuntimeException) {
				throw (RuntimeException) result;
			} else if (result instanceof Error) {
				throw (Error) result;
			} else if (result instanceof IOException) {
				throw (IOException) result;
			} else if (result instanceof Exception) {
				throw createIOException((Exception) result);
			}
			return result;
		} catch (final ClassNotFoundException e) {
			throw createIOException(e);
		} finally {
			LOG.info("http call done in " + (System.currentTimeMillis() - start) + " ms with "
					+ dataLength / 1024 + " KB read for " + url);
		}
	}
@Test
	public void testCall() throws IOException {
		Utils.setProperty(Parameters.PARAMETER_SYSTEM_PREFIX + "mockLabradorRetriever", "false");
		final File file = File.createTempFile("test", ".ser");
		try {
			try (ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file))) {
				output.writeObject(new Counter("http", null));
			}
			final URL url = file.toURI().toURL();
			final LabradorRetriever labradorRetriever = new LabradorRetriever(url);
			labradorRetriever.call();
			final Map<String, String> headers = Collections.emptyMap();
			final LabradorRetriever labradorRetriever2 = new LabradorRetriever(url, headers);
			labradorRetriever2.call();
		} finally {
			if (!file.delete()) {
				fail("file.delete");
			}
		}
	}