Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: bilsch Newsgroups: comp.lang.java.programmer Subject: my java is broken ! Date: Sun, 29 Apr 2012 05:13:14 -0700 Organization: A noiseless patient Spider Lines: 37 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 29 Apr 2012 12:13:16 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="llALXQ6TxsVqIoSLcrwVyA"; logging-data="32446"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LirplZXvI3MEJDmA+qdTM" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 Cancel-Lock: sha1:w7kOrrRCz6u6qjxUkC4kgMXT3rw= Xref: csiph.com comp.lang.java.programmer:14017 I wrote a loop to read a 26000 character text file NVRAM.TXT into a character array. It worked fine. The program is listed below. It has only 24 lines. Today when I run it, it has weird errors referenced to line numbers 2442, 2685 and 1620. When I click on those error messages it shows lines in a completely different program - a program that I never wrote for sure. I saved the file with a different name and it runs fine with that name - no errors. The file name that has the problem is Nvj5. That is the file selected and displayed when I click RUN FILE. It is the file listed below. Even though it is selected and displayed when I click RUN FILE my system is running some other huge file instead. Has anyone ever heard of a problem like this? import java.io.*; public class Nvj5 { public static void main(String[] args){ try { FileInputStream file = new FileInputStream("NVRAM.TXT"); char[] nvchr = new char [30000]; int fin = 1; int count = 1; while (fin != -1) { fin = file.read(); nvchr[count] = (char) fin; System.out.print(nvchr[count]); count++; } System.out.println("Bytes read : " + count); file.close(); } catch (IOException e){ System.out.println("Could not read file"); } } }