title: Replacing deprecated Java method
body: <p>I have multiple calls that use deprecated methods, such as</p>
  <pre><code>org.apache.commons.io.FileUtils.readFileToString(File file)
  
  org.apache.commons.io.IOUtils.toString(InputStream input)
  org.apache.commons.io.IOUtils.toInputStream(String input)
  </code></pre>
  <p>Now, I do know that these methods are <a href="https://commons.apache.org/proper/commons-io/javadocs/api-2.5/deprecated-list.html#method" rel="nofollow noreferrer">deprecated</a> and with which methods to replace them, for example</p>
  <pre><code>readFileToString(final File file, final Charset encoding)
  </code></pre>
  <p>The difference being that I have to specify an encoding.</p>
  <p>Now, because my primary goal is to preserve behaviour while removing the old methods, even if it means preserving bugs/oddities, I want to call the new method such that it works just like the old one.
  Reading the Javadoc for the new method reveals</p>
  <pre><code>* @param encoding the encoding to use, {@code null} means platform default
  </code></pre>
  <p>My assumption is now that if I pass <code>null</code> as encoding parameter to the new method, it will behave just like the old one. That would imply that the old method always used the platform default. But is there a way to check that?</p>