public static void write2LocalFromInternet(String imageUrl, File file)
			throws Exception {
		InputStream is = null;
		OutputStream os = null;

		try {
			URL url = new URL(imageUrl);
			is = url.openStream();

			os = new FileOutputStream(file);

			int length = -1;

			byte[] buffer = new byte[7092];
			while (-1 != (length = is.read(buffer, 0, 7092))) {
				os.write(buffer, 0, length);
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (is != null) {
				is.close();
			}
			if (os != null) {
				os.close();
			}
		}

	}