So be looked at byte streams knowledge let's look at the second degree or stream my characters dreams 2
and characters streams are used to read or write characters that are like text files but that will go 3
on top of byte streams as essentially everything is binary that is even text files are also binary files 4
. 5
No recall that just like the way input stream an output stream crosses some of the base classes for 6
all byte oriented streams read it and write up classes service based classes for a quarterly InterSystems 7
. 8
And in this lesson we will focus only on reader and writer process. 9
And let's just look at the reader class. 10
It is a bit abstract class. 11
For art Carco Ruby entered input streams and it is used to read 16 bit character data and you give 16 12
format as we know that July is based on you be of 16 encoding scheme. 13
And here is one right there. 14
And it is used to read that single character and get into the corresponding engrain you get for being 15
between zero and two to the power of 16 minus one. 16
That could be 65000 5:35 as you can see it is quite similar to the read method in the input stream class 17
. 18
There are only a single byte was being written on so the range was zero due to to the part of 8 minus 19
one that is 0 to 255. 20
And the method would read and minus one of the and nostri Mr. Director and here is the completion of 21
the read method which is used to re group of characters who have the input arrays a caterpillar. 22
Recall that in the read method in the input stream class it was a binary. 23
This mother would read up to the number of characters from the input stream into the input character 24
of the starting and index position offset under-treated set of characters entered or minus one. 25
If I nostri Mr. Dictator just that all the recalls would block that is that would block and then some 26
input data is available or some Iowa exception is generated or no stream is reached. 27
Now let's look at the right across. 28
It is a base abstract class for all character oriented output streams and it is used to write 16 bit 29
characters that aren't to our destination and the destination may use a different character format. 30
That is it could be something different from UTF 16. 31
And here is a method for writing one character to the output string here the input parameter is an int 32
which has 32 bits. 33
So the method writes The were two bytes. 34
That is the 16 bits that appear on the rightmost and unrest of the bits are discarded. 35
Recall that in case of output string class it was 8. 36
LU What are the words that were returned to the output stream. 37
And here is the second version of the right method. 38
And it is used to write group of characters. 39
So the method will write length number of characters from the input characters starting at the end exposition 40
offset. 41
And here is the inheritance tree for reading characters. 42
It trust most of the reader base classes and we will explore some of these classes. 43
The first ones we will look at will be buffered reader an input stream reader and as you may have guessed 44
Bufford reader will help us with buffering not to compare this with input stream based inheritance tree 45
. 46
You will also notice quite a bit of similarities. 47
And here is the inheritance tree for writing characters and it is very similar to the reader history 48
clearly shown here is the print writer class. 49
So that's about it. 50
And we mainly look at the reader and writer process which are the two best abstract classes for reading 51
and writing characters. 52
Thank you