I have a file have multiple lines.
For each line the format is
"String A" "String B" "binary data"
What I want to do is adding “String C” in front of each line
"String C" "String A" "String B" "binary data"
Now I am using BufferedReader.readline(), it seems like this method has problem when reading binary data.
Can any one give me some suggestions on solving this question?
If you have binary data in your file you shouldn’t use the readLine() method which assumes that your line will end with ‘\r’,’\n’ or “\r\n”. The “binary data” can contain that sequence by chance and mess up your readLine().
Generally speaking, you shouldn’t mix binary data with text data.