I've got a program that uses BufferedReader to read it's data. About a year ago my input source started showing up with binary characters, which of course breaks. After spending time trying to figure out where the binary data is coming from with no joy, and living with a stopgap sed script that strips the binary, I want to fix my program.
I should note that after running my input data through my sed script, the resulting file is identical to the original source that was sent to me. I have no control over the process by which I get the input text file.
I should also note that all the inserted binary data is 0x80 or higher. I don't want to just clear the 0x80 bit, that results in junk in my text. I want to delete all characters 0x80 or higher.
I'm not a Java guru and haven't written Java in a couple years now, so I turn to you.
What would be the best way to read my data, strip the binary data, and return a record just like BufferedReader.getRecord() does (that is, a text line ending in CRLF)? I'm not worried about the regexp to strip the binary data, I'm just not sure how to get the file data into a buffer that I can filter.
I should note that after running my input data through my sed script, the resulting file is identical to the original source that was sent to me. I have no control over the process by which I get the input text file.
I should also note that all the inserted binary data is 0x80 or higher. I don't want to just clear the 0x80 bit, that results in junk in my text. I want to delete all characters 0x80 or higher.
I'm not a Java guru and haven't written Java in a couple years now, so I turn to you.
What would be the best way to read my data, strip the binary data, and return a record just like BufferedReader.getRecord() does (that is, a text line ending in CRLF)? I'm not worried about the regexp to strip the binary data, I'm just not sure how to get the file data into a buffer that I can filter.