I want my code to read a txt file and print out each line, but nearly half of the lines are being skipped over seeming randomly. How do I ensure the entire file is read?
BufferedInputStream readIt = new BufferedInputStream(new FileInputStream(pBase));
//pBase is txt File object
Scanner actualRead = new Scanner(readIt);
while(actualRead.hasNextLine()){
System.out.println("Line is : " + actualRead.nextLine());
}