How to read a line from InputStream without buffering the input? [duplicate]
This question already has an answer here: Reading lines from an InputStream without buffering 3 answers I have an InputStream which contains a line as a string and then binary data. If I read the line using new BufferedReader(new InputStreamReader(inputStream)) , the binary data is being also read and cannot be re-read. How can I read a line without reading the binary data as well? * Update: It seems that InputStreamReader buffers (reads ahead) as well :( Posted another answer to directly read from the InputStream. Eventually did it manually :( I guess I missed a lot of cases like \r and white