title: Why FileOutputStream can't count space between string?
body: <p>I am trying to store the string in a file. But in every time if i put a space between two string it always read first string.</p>
  <pre><code>import java.util.*;
  import java.io.*;
  
  public class file_2 {
      Scanner sc = new Scanner(System.in);
  
      public void File() throws IOException {
          FileOutputStream fout = new FileOutputStream(&quot;./file_2.txt&quot;, true);
          // BufferedWriter bw=new BufferedWriter(fout);
          System.out.println(&quot;Write a string:&quot;);
          String s = sc.next();
          char ch[] = s.toCharArray();
          System.out.println(ch);
          for (int i = 0; i &lt; s.length(); i++) {
              fout.write(ch[i]);
          }
          fout.close();
          // System.out.println(&quot;Length:&quot;+length());
  
      }
  
      public static void main(String[] args) throws IOException {
          file_2 file = new file_2();
          file.File();
      }
  }
  </code></pre>