title: Write Integer Value to a File and Read it
body: <p>I got a Follower-check function in my twitch.bot and i need a read/write solution for it.</p>
  
  <p>It should do the following:</p>
  
  <p>Read an given Number(int) out of the file
  Write a new Number to the file and delete the old one
  Create the file if it doesnt exist</p>
  
  <p>(the File needs only to store 1 number)</p>
  
  <p>So how can i do this?</p>
  
  <p>right now, i got a String Reader and as soon as i read it i parse it into an INT but i only got errors so i think it doesnt work that way so im searching an option for writing/reading the int already without parsing it from a string.</p>
  
  <pre><code>import java.io.*;
  public class FollowerChecker {
  public static StringBuilder sb;
      static String readFile(String fileName) throws IOException {
          BufferedReader br = new BufferedReader(new FileReader(fileName));
          try {
              sb = new StringBuilder();
              String line = br.readLine();
  
              while (line != null) {
                  sb.append(line);
                  sb.append("\n");
                  line = br.readLine();
  
              }
              return sb.toString();
          } finally {
              br.close();
  
          }
      }
  
  
  
      public static void Writer() {
  
          FileWriter fw = null;
  
          try {
              fw = new FileWriter("donottouch.txt");
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
          StringWriter sw = new StringWriter();
          sw.write(TwitchStatus.totalfollows);
  
  
          try {
              fw.write(sw.toString());
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
          try {
              fw.close();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  }
  </code></pre>