title: Java Read Line Feed Characters
body: <p>I'm trying to read data from a text file that was written from strings containing <code>\n</code>. As a result, these characters have been written as line feeds. When I'm trying to read it back, </p>
  
  <p>I'm using a <code>FileInputStream</code>, <code>InputStreamReader</code> and a <code>BufferedReader</code>. However, when I read in each line, The reader notices the line feed and counts it as the end of the line.
  What I really want is to read to the end of the line, preserving the line breaks. I tried to see if I could actually write the characters <code>\</code> and <code>n</code> when creating the file, but no matter what I tried, they wouldn't write without turning into normal line breaks.</p>
  
  <p>How can I read in this file while preserving the line feeds?</p>
  
  <p><strong>Edit:</strong> For clarification, here is a sample of the data I'm reading. As is visible, each line that says <code>Args</code> is on its own line. This is the line break I want to ignore. I want each command (e.g. dt, e, b, c, o, etc.) to have it's own line. That would ideally look like this:</p>
  
  <pre><code>o Desc: Opens a file or folder#Args: [&lt;handle or path&gt;] -- the path of the file or folder#(&lt;file name&gt;) -- the name of the file to open. Omit if you are opening a folder.
  </code></pre>
  
  <p>I've replaced the line-feed characters I wish to ignore with a <code>#</code> symbol. However, when I read the file back into my program, I want it to be so that if I <code>System.out.println();</code> the line, the line-breaks that have been replaced with <code>#</code> will display correctly.</p>
  
  <pre><code>dt Desc: Toggles the state of debug mode.
  e Desc: Exits QuiConsole
  b Desc: Goes to the specified webpages.
      Args: [&lt;URLs&gt;] -- the URLs of the webpages to visit, separated by spaces
  c Desc: Clears the console window.
  o Desc: Opens a file or folder
      Args: [&lt;handle or path&gt;] -- the path of the file or folder
            (&lt;file name&gt;) -- the name of the file to open. Omit if you are opening a folder
  l Desc: Searches the web
      Args: [&lt;query&gt;] -- the query to search for
  h Desc: Displays a list of all the current handles.
      Args: (&lt;handle names&gt;) -- displays information for only the specified handles.
  info Desc: Displays information about QuiConsole
  help Desc: Displays a list of all commands, their descriptions and their arguments, if any exist.
      Args: (&lt;command names&gt;) -- Displays information for the specified command only. Ignores any invalid command names.
  s Desc: Shuts down, restarts, hibernates or logs off the computer.
      Args: [s,r,h,l] -- shuts down, restarts, hibernates or logs off the computer respectively.
            (&lt;integer value&gt;) -- the number of seconds to delay the action.
  dh Desc: Deletes all handles
      Args: (&lt;handle names&gt;) -- deletes only the specified handles
  r Desc: Runs the specified program
      Args: [&lt;names&gt;] -- the names of the programs to run. Separate programs by a space.
  wa Desc: Displays the answer from Wolfram|Alpha
      Args: [&lt;query&gt;] -- the query to send to Wolfram|Alpha
  ch Desc: Modifies a handle
      Args: [&lt;handle names&gt;] -- the handle to change
            [&lt;new value&gt;] -- the new value to assign to the handle
  ah Desc: Adds the specified handles.
      Args: [handle] -- name of the handle.
            [value] -- value for the handle
  ds Desc: Displays the state of debug mode.
  dhist Desc: Deletes command history
  </code></pre>