title: How can I limit bandwidth in Java?
body: <p>I wrote a Java scheduler, every hour using:</p>
  
  <pre><code>new SAXBuilder().build(new URL(xxx));
  </code></pre>
  
  <p>or </p>
  
  <pre><code>HttpConnection.connect(new URL(xxx)); // jsoup library code
  </code></pre>
  
  <p>to get a big XML/HTML file.</p>
  
  <p>My server maximum bandwidth limit is 2Mbits.</p>
  
  <p>When this Java schedule code runs, I use over 2Mbits of bandwidth.  (<a href="http://clip2net.com/clip/m10494/1287201166-clip-4kb.png" rel="noreferrer">check it out</a>)</p>
  
  <p>So every time a user visits my server it is too slow.</p>
  
  <p>How do I limit my Java schedule to use lower bandwidth?
  (ex. 500Kbits)</p>
  
  <p>I am using Ubuntu server.</p>