title: What throws an IOException in Java?
body: <p><code>java.io.IOException</code> seems to be the most common type of exception, and coincidentally, it seems to also be the most ambiguous.</p>
  <p>I keep seeing the <code>throws IOException</code> whenever writing with sockets, files, etc. I've never actually had one fired on me, however, so I'm wondering what it is that is supposed to fire the exception. The documentation isn't very helpful in explaining what's going on:</p>
  <blockquote>
  <p>Signals that an I/O exception of some sort has occurred. This class is the general class of exceptions produced by failed or interrupted I/O operations.</p>
  </blockquote>
  <p>What are some instances where an IOException would be thrown, and how is it supposed to be used?</p>