title: Reading all content of a Java BufferedReader including the line termination characters
body: <p>I'm writing a TCP client that receives some binary data and sends it to a device. The problem arises when I use BufferedReader to read what it has received.</p>
  
  <p>I'm extremely puzzled by finding out that there is no method available to read all the data. The <code>readLine()</code> method that everybody is using, detects both <code>\n</code> and <code>\r</code> characters as line termination characters, so I can't get the data and concat the lines, because I don't know which char was the line terminator. I also can't use <code>read(buf, offset, num)</code>, because it doesn't return the number of bytes it has read. If I read it byte by byte using <code>read()</code> method, it would become terribly slow. Please someone tell me what is the solution, this API seems quite stupid to me!</p>
  
  <hr>
  
  <p>Well, first of all thanks to everyone. I think the main problem was because I had read tutorialspoint instead of Java documentation. But pardon me for it, as I live in Iran, and Oracle doesn't let us access the documentation for whatever reason it is. Thanks anyway for the patient and helpful responses.</p>