Hi ,
i have some question regrading chracter Stream.
1- when we write data through "PrintStream class" and read through "BufferInputStream class" method readLine().
It is recmonded that the sequence in which u write the data, You must be read in that order. Otherwise u get FormateException.
What is the reason of such sequence of reading data . Even casting is not helpfull ??
2 - "PrintStream class" write data into file. It write into file Least Significant bits or Most Significant bits???
The sample code is more accurate for u ..
PrintWriter pw = new PrintWriter( new OutputStreamWriter ( new FileOutputStream ("aatif.txt"), "UTF8" ) ,true ) ;
pw.println('A') ;
pw.println('B') ;
pw.close();
FileInputStream fi = new FileInputStream ("aatif.txt");
int a1 =0;
while ( ( a1 = fi.read() ) != -1 ){
System.out.println(a1);
}
This code generates the out put is
65
13
10
66
13
10
The 65, 66 is ASCII code (A, B) but what about 13 , 10 .
If i write int type data then out is also very confusing me , That what is the writing and reading process of stream .???
As I am comfortable with ByteStram .
Please Help me .
Thanks in Advance
:roll: