This can be confusing, particularly if you're already familiar with InputStream, and keep getting deprecated API warning messages. Let me simplify it for you.
If you're reading data, such as bytes of information, you are best off to use InputStreams and DataInputStream in particular.
If you're reading in text, and want to be able to call a readLine() method, its best to use Readers, and BufferedReader in particular.
So what's the difference? Well, DataInputStream's readLine() method is deprecated, because of problems with this method. Readers offer an alternative - though placing a readLine() method in a BufferedReader still seems a little odd to me. Whether its buffered or not has little to do with the fact it can read lines of text - but its easy enough to live with.
www.referjava.com
No comments:
Post a Comment