title: Writer dont writing in file but only create it
body: <p>Im working on converter. I load file, start reading date from it and creating directories by year, month and day(+ another one dir) in witch ends are those converted text files. Everything is fine while creating those directories but in text files is nothing or only chunk of it.</p>
  
  <pre><code>public static void convertFile(File fileToConvert, File whereToSave, long shift) {
      BufferedReader reader = null;
      BufferedWriter writer = null;
      String oldDate = "";
      String newDate = "";
      boolean boolDate = true;
  
      try {
  
          for (File file : fileToConvert.listFiles()) {
              reader = new BufferedReader(new FileReader(file));
  
              boolean block = true;
              String line = "";
              int lineCounter = 0;
              while ((line = reader.readLine()) != null) {
                  if (lineCounter==0) {
                      block = true;
                  } else {
                      block = false;
                  }
  
                  line = line.replaceAll("[^0-9-,:+NaN.]", "");
                  String[] data = line.split(",");
  
                  if (block) {
                      data[0] = data[0].substring(0, 10) + " " + data[0].substring(10);
                      data[0] = SimulatorForRealData.timeShift(data[0], shift);
                      // ====================================================================================
                      newDate = data[0].substring(0, 4) + " " + data[0].substring(5, 7) + " "
                              + data[0].substring(8, 10);
  
                      String savingIn = SimulatorForRealData.createDirs(whereToSave.toString(),
                              data[0].substring(0, 4), data[0].substring(5, 7), data[0].substring(8, 10));
  
                      File f = new File(savingIn + "\\" + FILE_NAME + ".log");
  
                      if (!newDate.equals(oldDate) &amp;&amp; boolDate == false) {
                          writer.close();
                          boolDate = true;
  
                      } else {
                          oldDate = newDate;
                          boolDate = false;
  
                      }
  
                      writer = new BufferedWriter(new FileWriter(f));
  
  
  
                      // =====================================================================================
                      writer.write("&lt;in date=\"" + data[0].substring(0, 10) + "T" + data[0].substring(11)
                              + "\" t=\"1\" &gt;\n");
                      writer.write(data[0] + "\n");
                      writer.write(0 + " " + 0 + " " + 0 + "\n");
                      for (int x = 0; x &lt;= 10; x++) {
                          writer.write("NaN" + " ");
                      }
                      writer.write("\n");
  
                      for (String s : data) {
                          if (s.equals(data[0])) {
                              continue;
                          }
                          writer.write(s + ";");
                      }
                      writer.write("\n");
                  } else {
                      for (String s : data) {
                          writer.write(s + ";");
                      }
                      writer.write("\n");
                  }
                  lineCounter++;
                  if (lineCounter == 118) {
                      lineCounter = 0;
                      writer.write("&lt;/in&gt;\n\n");
                  }
  
              }
          }
      } catch (IOException e) {
          e.printStackTrace();
      } finally {
          try {
              writer.close();
              reader.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Here is method where i perform it. Can someone help me. I tried different "writers" and nothing. I have suspicious that it will be problem in closing file but i dont know for sure.</p>