title: How do I get a file length?
body: <p>I am trying to get the length (in bytes) of a file, but every time I test different files, the result is invariably 4065123.0.</p>
  
  <p>This is the relevant portion of my code:</p>
  
  <pre><code>File file = new File(path + filename);
  if(!file.exists()) {
      System.out.println("File does not exist");
  } else {
      double bytes = file.length();
  }
  </code></pre>
  
  <p>How do I correctly get the length of a file?</p>