I MAY have found a solution: InputStream will not reset to beginning HOW can i implement this into my code? I need to read a text file more than once using:
while (true){
final String checkUsername = brUsername.readLine();
if (checkUsername == null) {
break;
}
if (checkUsername.equals(usernameInput)) {
correctUsername = true;
}
}
The readers and writers:
FileWriter fwUsername = new FileWriter("Username.txt", true);
FileReader frUsername = new FileReader("Username.txt");// reads the created file Username.txt
PrintWriter pwUsername = new PrintWriter(fwUsername, true);
BufferedReader brUsername = new BufferedReader(frUsername);
I can't do this while loop more than once. NO ERROR is given but the while loop is SKIPPED. 1. How can I repeat this loop? 2. If I can't repeat this loop, how can i store all of its values so i can check it like that? 3. This link may have a solution but i don't know how to do the answer: How to reopen a file from a input stream. I am a beginner so I don't have much knowledge. The code i am using: dropbox.com/s/du1u01f27t0ok2o/codehelp.txt?dl=0