title: java.io.IOException: Mark invalid
body: <pre><code>public void createNewUser(String name, String passwort) {
          try {
              br = new BufferedReader(new FileReader("Data.txt"));
          } catch (FileNotFoundException brCreateError) {
              brCreateError.printStackTrace();
          }
  
          try {
              br.mark(1);
              System.out.println(br.readLine());
              try {
                  if(br.readLine()==null) {
                      noUser=true;
                  }else {
                      noUser=false;
                  }
              } catch (IOException e) {
                  e.printStackTrace();
              }
              br.reset();
  
          } catch (IOException brMarkError) {
              brMarkError.printStackTrace();
          } ...
  </code></pre>
  
  <p>Why is the markedChar value changing to -2 after passing the if-statement?</p>
  
  <p>Thx for every answer Nico.</p>