Is there anyway this program can work the way I want it to work!!??

Since I had no idea, how to make a new line in .txt in my program(writeBytes("\n") will just make a rectangle in the .txt file)..i decided that I should make a method..below:
public static String makeLine(int bytesReq)
          String lines = " ";
          //bytesReq /= bytesReq;
          for(int i = 0; i < bytesReq; i++)
               lines += lines;
          return lines;
     }I wanted program to create a string of empty spaces..depending on the number so I can use it later...in this code..which transfers the stuff inside my link list into the .txt file...
     public static void loopList()throws IOException
          try
               RandomAccessFile rand = new RandomAccessFile(filet, "rw");
               EmpLink current;
               current = first;
               if(first==null)
                    delay(options.geTime());
                    System.out.println("List is empty!");
               else
                    //rand.seek(filet.length());
                    while(current != null)
                         for(int i = 0; i < options.getLoops(); i++)
                              rand.seek(filet.length());
                             rand.writeBytes("ID: "+current.emp_id + " Name: " + current.fname + " Surname: " + current.lname+" ");
                              rand.seek(filet.length());
                              rand.writeChars(makeLine((int)filet.length()/2));
                         current = current.next;
                    delay(options.geTime());
                    System.out.println("TRANSFER COMPLETE!!");
                    System.out.println();
          catch(Exception enk)
               System.out.println("");
               System.out.println("There has been a fatal error during execution!!");
               System.out.println("");
     }when I compile it seem to work but when I run it...it has a OutOfMemoryException..and I don't know why..later I used the length of the string of the ID, Firstname, Lastname but then...something weird happens....
all of them is repeated three times in .txt and I have no clue why?..
And right now the .txt file has some kind of east asian characters written in it and is 513KB and still don't have a clue why...
all I want is to have the next set of data go into the next line....
Please help...

DaDonYordel wrote:
Since I had no idea, how to make a new line in .txt in my program(writeBytes("\n") will just make a rectangle in the .txt file)..i decided that I should make a method..below:
public static String makeLine(int bytesReq)
          String lines = " ";
          //bytesReq /= bytesReq;
          for(int i = 0; i < bytesReq; i++)
               lines += lines;
          return lines;
This returns a string 2^bytesReq long because it doubles in length on every pass.

Similar Messages

Maybe you are looking for

  • SRM 4.0: Source of Supplier not copying in line item on Shopping Cart

    We are using SRM 4.0 in an extended classic setup and currently experiencing a problem with the source of supplier not being copied on line items. The user stated that  when copying a line items in a shopping cart the source of supplier is not copyin

  • Logic board Q

    Does anyone know if a logic board from Dual USB G3 12" will fit in a Dual USB G3 14"?

  • Calendar sync between iCal, Outlook 2011 and 2010 and iCloud

    All, I'm having trouble syncing calendars on my devices and I haven't been able to find a workable solution yet. I know this topic has been covered extensively, but I haven't found anything that works. I want to be able to sync my calendars (email wo

  • Repository changes in online mode in HA environment

    Hello, Is it possible to make changes to the rpd in online mode within a highly available (horizontally scaled on two virtual hosts, Host1 and Host2) OBIEE 11g environment without disrupting users? Here's what currently happens in my environment, and

  • Windows 7 64bit Office 2010 64bit and Captivate v5.5

    I am due to have a new PC with Windows 7 64bit and Office 2010 64bit. I am running Captivate v5.5. Does anyone know if I am going to run into any problems with the above PC spec when working with Captivate v5.5? Thanks in advance, Noel