How to programmatically limit the download speed?
问题 I use the following code to limit the download speed of a file in java: package org; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; class MainClass { public static void main(String[] args) { download("https://speed.hetzner.de/100MB.bin"); } public static void download(String link) { try { URL url = new URL(link); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setConnectTimeout(5000); con.setReadTimeout