Whenever I have to work with topics like file-handling or socket-programming, I have to look for sample code on the internet to see how the xxStreamxx,xxReader,xxWriter classes are used.
I want to be able to use them on my own and know how they work.
How do I go about learning that?
First of all, you have to learn and understand what streams are. If you don’t understand the concepts behind them, you will be always copying code. So read the “Basic I/O lesson of the java tutorial”: http://docs.oracle.com/javase/tutorial/essential/io/streams.html. A comprehensive presentation about this topic is this one from javapassion.com: http://www.javapassion.com/javase/javaiostream.pdf.
While reading, as I usually told my students: “write code and make mistakes” 🙂