import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; public class WebLength { public static void main(String args[]) throws Exception { URL url = new URL("http://www.exemple.com"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); int taille_oct = conn.getContentLength(); if (taille_oct>=0) System.out.println("Content-Length: " + taille_oct); } }