1

00:00:08,360  -->  00:00:09,450
Hi there.

2

00:00:09,450  -->  00:00:12,660
This is Diliman Hello and welcome back.

3

00:00:12,660  -->  00:00:19,050
Let's look at I will which stands for input and output in any software.

4

00:00:19,050  -->  00:00:25,980
It's very common to read data from some source and also to write some data up to some destination for

5

00:00:25,980  -->  00:00:32,700
instance as this diagram shows is source or the destination can be a fine which can be on a local machine

6

00:00:32,970  -->  00:00:35,790
or even on some remote the server.

7

00:00:35,970  -->  00:00:42,540
In this case you can read something from a file or you can also write something into we are fine example

8

00:00:42,540  -->  00:00:47,370
we'll be reading some data see us we find are generating a CSP file.

9

00:00:47,730  -->  00:00:54,630
Which means that you're writing something in DC as we fight it on here to aioli or is simply a software

10

00:00:54,630  -->  00:01:00,840
component that specializes in doing that reading and writing.

11

00:01:00,840  -->  00:01:07,380
Similarly when you're interacting with a web service like send rest API you would request some data

12

00:01:07,500  -->  00:01:15,330
on process response and when requesting data you mean sometimes how to send some data with the API that

13

00:01:15,330  -->  00:01:20,360
is your right data onto the network which will be passed on to the API server.

14

00:01:20,790  -->  00:01:27,360
And this gives the rest server who would act as a destination understrapper your server would then send

15

00:01:27,360  -->  00:01:33,400
some response back in which gives the rest of us or were would also act as its source.

16

00:01:33,630  -->  00:01:37,360
So the rest of us are is acting as both source and destination.

17

00:01:37,930  -->  00:01:46,350
And sometimes we have to download webpages for example in our application may want to download all the

18

00:01:46,350  -->  00:01:53,220
web links in the system so that users can search the contents of those babblings in disguise.

19

00:01:53,490  -->  00:01:56,730
The remote web server acts as a source.

20

00:01:56,730  -->  00:02:02,690
In fact run off or project extensions and this chapter is about downloading ramblings.

21

00:02:02,790  -->  00:02:08,820
So these are some common activities and many times they can be very critical from a business standpoint

22

00:02:09,600  -->  00:02:16,710
and this chapter is all about how we can read data from such different sources and also how we can write

23

00:02:16,710  -->  00:02:19,160
data to different destinations.

24

00:02:19,740  -->  00:02:23,440
Just know that our destination is also referred to as us.

25

00:02:24,770  -->  00:02:32,790
But as a language we are creating a good I will frame work is very challenging and one reason is due

26

00:02:32,790  -->  00:02:41,300
to the different types of sources and sinks in one like file network console and so on.

27

00:02:41,460  -->  00:02:47,100
And second is due to the number of different areas in which we can communicate with these different

28

00:02:47,100  -->  00:02:48,560
social son.

29

00:02:48,900  -->  00:02:54,990
For example sometimes you may want to read the dot sequence Cheney and sometimes you may want to read

30

00:02:54,990  -->  00:03:01,950
that a dot randomly and in some cases you may want to read the data as individual bytes.

31

00:03:02,190  -->  00:03:08,760
And in some other cases you may want to read them as a group halfbacks Also the data format can be different

32

00:03:08,760  -->  00:03:09,310
too.

33

00:03:09,570  -->  00:03:13,880
That is data that can be in binary or in character format.

34

00:03:14,970  -->  00:03:23,070
I guess this job is a nurse created lots and lots of specialized classes and these specialized classes

35

00:03:23,220  -->  00:03:26,390
can be combined or changed in different ways.

36

00:03:26,580  -->  00:03:33,180
And one most common benefit of such a training is to improve the speed in performing input and output

37

00:03:33,190  -->  00:03:33,580
.

38

00:03:33,990  -->  00:03:39,870
So there are process which will specifically help in improving speed and you will see how we can use

39

00:03:39,870  -->  00:03:40,710
them.

40

00:03:41,660  -->  00:03:45,000
No Djala comes with two sets of packages.

41

00:03:45,120  -->  00:03:46,960
One is java.io God I will.

42

00:03:47,010  -->  00:03:50,670
It is referred to as my will and second is gelada.

43

00:03:50,700  -->  00:03:55,510
And I will which is referred to as new I will doctor I will.

44

00:03:55,520  -->  00:03:56,920
Was there from the beginning.

45

00:03:57,140  -->  00:04:04,380
Well and I was introduced in July 4 and in this chapter we will focus only on stream my will as it is

46

00:04:04,380  -->  00:04:12,160
most commonly used in the future I'm most likely Aard one or two lessons on Jemadar and I will.

47

00:04:12,690  -->  00:04:18,610
And here are the things we will see in this chapter which fall under stream I will Lytton's my well

48

00:04:18,610  -->  00:04:18,700
.

49

00:04:18,750  -->  00:04:20,660
There are two sets of packages.

50

00:04:20,700  -->  00:04:28,110
The first set of packages is classified as byte strings under use for handling binary data such as images

51

00:04:28,110  -->  00:04:28,680
.

52

00:04:29,160  -->  00:04:34,910
And the second set of packages is classified as character streams under use for handling characters

53

00:04:35,190  -->  00:04:37,770
like Ex-Files under that exploit.

54

00:04:37,800  -->  00:04:46,020
Each of them separately not within byte streams we will see how we can read and write binary data such

55

00:04:46,020  -->  00:04:49,050
as images in an efficient way.

56

00:04:49,740  -->  00:04:55,210
And in the process we will also look at a design pattern called decorator pattern.

57

00:04:55,800  -->  00:05:02,490
We will also see how we can see you everyday Guler Java objects to disk and how we can read them back

58

00:05:02,490  -->  00:05:11,310
from the disk and get them to cross streams Vivan see how we can read and write text content in an efficient

59

00:05:11,310  -->  00:05:13,140
way.

60

00:05:13,200  -->  00:05:18,610
We will also see how we can collect input from the user through the console.

61

00:05:18,690  -->  00:05:20,330
That is a command prompt.

62

00:05:20,490  -->  00:05:24,460
So we will see how we can make our program interact with the user.

63

00:05:25,770  -->  00:05:27,550
And lots of several demos.

64

00:05:27,750  -->  00:05:33,280
And most importantly we'll be making few important extensions to our project.

65

00:05:33,450  -->  00:05:39,720
Now in the current portion of the project most of the data such as user and Marber how been hardcoded

66

00:05:39,720  -->  00:05:47,610
in jar files but with the new extension liberalitie the same data from text files and other extension

67

00:05:47,610  -->  00:05:50,710
would be to download ramblings that is good.

68

00:05:50,750  -->  00:05:56,810
Note that actually the page content of those who blinks and then write them to their desk.

69

00:05:56,940  -->  00:06:01,270
That way we will see how we can go right back to their desk.

70

00:06:02,400  -->  00:06:09,370
But before we do any of this we also have a prerequisite Allison caracter in coding and it is the first

71

00:06:09,370  -->  00:06:15,870
lesson of the chapter understanding Conacher and coding is very important if we want to write programs

72

00:06:16,020  -->  00:06:18,360
that read and write text.

73

00:06:18,570  -->  00:06:24,030
So it is a fundamental lesson and if youre not of enough character encoding then you definitely should

74

00:06:24,030  -->  00:06:27,460
not give this lesson and thats about it.

75

00:06:27,480  -->  00:06:31,470
So lets go ahead and learn all about performing and put on outworker
