I was trying to redo File Input/Output again because I sort of forgot and I ran into a problem.
import java.io.*; import java.util.concurrent.TimeoutException; public class FileIO { public static void main(String args[]) { FileInputStream inputStream = null; try { inputStream = new FileInputStream("X:\\Users\\unCryptifier\\Documents\\Scores.txt"); } catch (FileNotFoundException e) { e.printStackTrace(); } byte readingBytes[] = new byte[24]; char convertedBytes[] = new char[5]; String scores[] = new String[5]; int i = 0; while (i != -1) { try { readingBytes[i] = (byte)(inputStream.read()); } catch (IOException e) { e.printStackTrace(); } System.out.println((char)(i)); } } }
The file that I'm trying to open has the numbers 0 to 25 in it with no space or lines in between. When I run the program, nothing shows in my console. It's running but nothing shows up and when I terminate the program, the only output it shows is space. I don't get what the problem is.