Sign in to follow this  
johnnyBravo

Java, Is there any file reading classes that don't get stopped at line breaks \n?

Recommended Posts

Hi, I was wondering if there are any text file reading classes that don't get interupted at line breaks "\n" ? I might be able to get around that, but it would be nicer to have a class that could read the entire line without stopping at the line breaks. Thanks

Share this post


Link to post
Share on other sites
"Text file" is incompatible with "don't get interrupted at \n"; the idea behind opening something in text mode rather than binary mode (and I know Java doesn't have things like ios::text or ios::binary; I'm talking conceptually) is that newlines get special treatment - in particular, they are separators.

That said, you might consider ByteArrayInputStream or DataInputStream (which are really intended to work with "binary files", however accurately you suppose that can be defined...).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this