J
Jeffery Miller
Hi all. I am a novice Java programmer trying to read in a text file line by
line. I have successfully done this many times before, but trying to do it
now, I am having trouble. In the past, the files that I read in were only a
few kilobytes. This time, the file is about 500k so I think that's the
problem. It reads in about 90 lines and then I get Exception in thread
"main" java.io.IOException: Stream closed. Here's the relevant code that I
am using:
while ((nextLine = br.readLine()) != null){
System.out.println("Start");
len=nextLine.length();
System.out.println("Length = " + len );
System.out.println(nextLine);
if (len > 0){
System.out.println("yes");
while (j <= 14) {
a=nextLine.charAt(j);
tempbuff.append(a);
j++;
}
Any help would be greatly appreciated.
Thanks.
line. I have successfully done this many times before, but trying to do it
now, I am having trouble. In the past, the files that I read in were only a
few kilobytes. This time, the file is about 500k so I think that's the
problem. It reads in about 90 lines and then I get Exception in thread
"main" java.io.IOException: Stream closed. Here's the relevant code that I
am using:
while ((nextLine = br.readLine()) != null){
System.out.println("Start");
len=nextLine.length();
System.out.println("Length = " + len );
System.out.println(nextLine);
if (len > 0){
System.out.println("yes");
while (j <= 14) {
a=nextLine.charAt(j);
tempbuff.append(a);
j++;
}
Any help would be greatly appreciated.
Thanks.