title: Serialization I/O with Java
body: <p>so lately I've been posting similar questions on Java here. Each time someone answers my questions, more questions arise.
  Thank you all in advance. Solved the append issue, now making things pretty.</p>
  
  <p>[File.java]</p>
  
  <pre><code>public class File {
  
      public static void main(String[] args) {
  
          FileWrite fW = new FileWrite();
  
          try (BufferedReader br = new BufferedReader(new FileReader("B:\\LongIn.dat"))) {
              String stCurrent;
              while ((stCurrent = br.readLine()) != null) {
                  System.out.println(stCurrent);
                  fW.serializeAddress(stCurrent);
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  }
  </code></pre>
  
  <p>[FileWrite.java]</p>
  
  <pre><code>public class FileWrite {
  
      public void serializeAddress(String in) {
          try {
              File file = new File("B:\\LongOut.txt");
              if (!file.exists()) {
                  file.createNewFile();
              }
  
              FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
              BufferedWriter bw = new BufferedWriter(fw);
              bw.write(in);
  
              bw.close();
  
              System.out.println("Done");
          } catch (Exception ex) {
              ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Now my program appends when writing strings into the file. But then I have two questions.</p>
  
  <ol>
  <li><p>On the reading side, what is a good way to deposit a lot of strings into some variable so that my program can play with it?</p></li>
  <li><p>Append output works, but then it is not nicely organized. As in, the results are meshed up with each other on the output file. How do I make the output all lined up and looking good?</p></li>
  </ol>