This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi folks, i found the following about the InputStreamReader: [B] [/B] i don't really understand when it says from bytes to characters.is it true that everything written in console is byte that needs to be converted in characters like shown in above code snippet? it would be great help if you explain me this concept in layman's term. thanks. [ July 07, 2003: Message edited by: Namaste Sathi ]
hi sathi here is what i understand. Byte streams can work with any streams (as anything essentially is a byte format). Character streams is a easy way of handling data "if we know the data is character data". e.g. - if we wonna read image then we don't use Character stream as u can't really print image the way u 'd display characters, right? - if we wonna read a file that has some user data which is a text then we use Character stream rather than the Byte stream to have greater advantage of methods like readLine() and things... now, when we need InputStreamReader()??? when the input source can't be predicted till runtime the API methods (java api or custom api) can return byte stream object as we can read any data with byte streams BUT if we know (being in specific application) that the input is always a file having ascii characters then we can use InputStreamReader as bridge b/w byte stream that we get from the API method and the Readers we have in our code to deal input data as characters. regards maulin