title: Read last character of a text file
body: <p>I got this little code snippet which works just fine:</p>
  
  <pre><code>List&lt;String&gt; lines = Files.readAllLines(
                  Paths.get(f.getAbsolutePath()), Charset.defaultCharset());
  if (lines.size() &gt; 0) {
              char c = lines.get(lines.size() - 1).charAt(
                      lines.get(lines.size() - 1).length() - 1); 
  }
  </code></pre>
  
  <p>But this uses java.nio package which is not available prior <code>Java 1.7</code>.</p>
  
  <p>Now I need a reliable way to accomplish the same with prior Java versions.
  Do you have an idea ? The only thing I can think of, is to read the file line by line with a <code>BufferedReader</code> and if the reading is complete somehow retrieve the last character from this.</p>