What's the benefit of using InputStream over InputStreamReader, or vice versa.
Here is an example of InputStream in action:
InputStream input = new FileInputStream("c:\\data\\input-text.txt");
int data = input.read();
while(data != -1) {
//do something with data...
doSomethingWithData(data);
data = input.read();
}
input.close();
And here is an example of using InputStreamReader (obviously with the help of InputStream):
InputStream inputStream = new FileInputStream("c:\\data\\input.txt");
Reader reader = new InputStreamReader(inputStream);
int data = reader.read();
while(data != -1){
char theChar = (char) data;
data = reader.read();
}
reader.close();
Does the Reader process the data in a special way?
Just trying to get my head around the whole i/o streaming data aspect in Java.