title: java.nio.charset.MalformedInputException: Input length
body: <p>Code that reads word from file creates file with that name and writes content is it something to do with sw changes cause it worked fine till recently. Changed code and also the charset still the error</p>
  
  <pre><code>public class ForRwWr {
  
      public static void main(String[] args) {
          BufferedWriter bw = null;
          FileWriter fw = null;
          BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  
          try {
              BufferedReader in = new BufferedReader(new java.io.FileReader("F:\\words.txt"));
              String str;
              String fileName = "F:\\words.txt";
              List&lt;String&gt; lines = Files.readAllLines(Paths.get(fileName), Charset.defaultCharset());
  
              for (String Ad : lines) {
                  String FILENAME = "F:\\" + Ad + ".html";
  
                  try {
                      fw = new FileWriter(FILENAME);
                      bw = new BufferedWriter(fw);
  
                      bw.write("Orbital Science");
                      bw.write("Satellite Navigation");
                      bw.write("Satellite Navigation");
                      bw.write("Hongyan");
                  } catch (IOException d) {
                      d.printStackTrace();
                  } finally {
  
                      try {
                          if (bw != null)
                              bw.close();
  
                          if (fw != null)
                              fw.close();
                      } catch (IOException ex) {
                          ex.printStackTrace();
                      }
                  }
              }
          } catch (IOException d) {
              d.printStackTrace();
          } finally {
  
              try {
                  if (bw != null)
                      bw.close();
  
                  if (fw != null)
                      fw.close();
              } catch (IOException ex) {
                  ex.printStackTrace();
              }
  
          }
      }
  }
  </code></pre>
  
  <p>worced fine till recently but now gives the error </p>
  
  <blockquote>
    <p>java.nio.charset.MalformedInputException: Input length</p>
  </blockquote>
  
  <p>changed the charset and now the error is </p>
  
  <pre><code>java.io.FileNotFoundException: F:\Wonderful         .html (The filename, directory name, or volume label syntax is incorrect)
      at java.io.FileOutputStream.open0(Native Method)
      at java.io.FileOutputStream.open(FileOutputStream.java:270)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:213)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:101)
      at java.io.FileWriter.&lt;init&gt;(FileWriter.java:63)
      at html.ForRwWr.main(ForRwWr.java:36)
  java.io.FileNotFoundException: F:\      .html (The filename, directory name, or volume label syntax is incorrect)
      at java.io.FileOutputStream.open0(Native Method)
      at java.io.FileOutputStream.open(FileOutputStream.java:270)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:213)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:101)
      at java.io.FileWriter.&lt;init&gt;(FileWriter.java:63)
      at html.ForRwWr.main(ForRwWr.java:36)
  BUILD SUCCESSFUL (total time: 2 seconds)
  </code></pre>
  
  <p>Wonderful and Android are the words from file till recently worced fine what it did is tooc user input and wrote it to files with the file name as the word from file funny thing technology what worced yesterday !does worc today or has bein haced</p>