title: How to make file input stream ignore escape characters
body: <p>Essentially i have this method that is supposed to read raw characters from a file and return them but something that i had'nt taken into account was the fact that it would add escape sequences to the returned string when it hit a return or the like in the file. For example if i have a text file with this in it</p>
  
  <pre><code>The dog is brown.
  The dog is furry.
  </code></pre>
  
  <p>the method returns this</p>
  
  <pre><code>The dog is brown.\r\nThe dog is furry.
  </code></pre>
  
  <p>what i want it to return is</p>
  
  <pre><code>The dog is brown. The dog is furry.
  </code></pre>
  
  <p>I want when the input stream reads the escape \r to replace it with a space and when it reads \n to ignore it. Here is the method any help is appreciated.</p>
  
  <pre><code>public String getCharacters(File file, int number)  throws IOException {
           Reader r = new BufferedReader(new InputStreamReader(
                    new FileInputStream(file), "UTF-8"));
            try {
              StringBuilder resultBuilder = new StringBuilder();
              int count = 0;
              int intch;
              while (((intch = r.read()) != -1) &amp;&amp; count &lt; number) {
                resultBuilder.append((char) intch);
                count++;
              }
              return resultBuilder.toString();
            } finally {
              r.close();
            }
      }
  </code></pre>