title: Best practices regarding allowing many different types to constructors?
body: <p>I have a class called RawReader that reads the bytes of some resource, parses them, then writes files to an output directory.</p>
  
  <p>It makes sense to allow different types to be passed in as the source and destination to the constructor.</p>
  
  <ul>
  <li>Source: String (of file or URL), URL, File or InputStream</li>
  <li>Destination: String (directory) or File</li>
  </ul>
  
  <p>However if I overload the constructor that leaves me with 8 different versions. If I wanted to add a third optional argument for example <code>chunkSize</code> <em>I'd have 16 constructors!</em></p>
  
  <p>On the other hand I could just have two constructors accepting <code>(Object, Object)</code> and <code>(Object, Object, int)</code>. The argument types could be detected and an IllegalArgumentExceptions thrown if they aren't correct.</p>
  
  <p><strong>How are situations like this normally handled in Java?</strong></p>