1 00:00:00,120 --> 00:00:07,620 In this part, we are going to talk about above us and stream in and stream is to let us using the data 2 00:00:07,620 --> 00:00:08,720 before fully to read. 3 00:00:09,150 --> 00:00:11,610 And there are two ways to read the files. 4 00:00:11,610 --> 00:00:18,390 And now you can see I already paste a large text file and there are a lot of parts here. 5 00:00:19,080 --> 00:00:26,190 And one way is to wait until it has been read and the other is to pass the piece of data halfway through. 6 00:00:26,190 --> 00:00:32,290 And a small chunk of data has picked up into a first and sent it on to the stream every time to for 7 00:00:32,460 --> 00:00:32,610 it. 8 00:00:33,030 --> 00:00:39,660 So now we back to the project and go to the app called Jazz, and we are going to delete this command 9 00:00:40,110 --> 00:00:44,060 and we are going to create a stream to read that file. 10 00:00:44,340 --> 00:00:53,130 So we are going to create a constant stream echo to create a stream. 11 00:00:53,970 --> 00:01:02,230 And we are going to post a file to this so that we are going to read this file to file an enemy's passport 12 00:01:02,400 --> 00:01:02,960 text. 13 00:01:03,390 --> 00:01:13,800 So next year we type we stream stored on data and then tunc and we're stream on data and been listening 14 00:01:13,800 --> 00:01:17,010 to the data everand on this stream. 15 00:01:17,010 --> 00:01:24,660 So every time we get a chunk of data and we will fire this Corbat and this callback is going to do a 16 00:01:24,730 --> 00:01:31,990 download, we indicate that this is a new chunk of data and then we also lock the chunk. 17 00:01:32,280 --> 00:01:40,830 Now, if we won the program by typing knocked up and you can see this before us pop up in the console 18 00:01:40,980 --> 00:01:46,920 in order to make this readable, we can go to here and at a two string method. 19 00:01:47,610 --> 00:01:53,730 So if we run the program again and you can see these are the words instead of the puffer, we can also 20 00:01:53,730 --> 00:01:56,520 has another method to make this readable. 21 00:01:56,640 --> 00:02:00,930 And this is to add and compare the method in the second argument. 22 00:02:00,940 --> 00:02:04,800 So we type and cocktailing and neuter it. 23 00:02:06,210 --> 00:02:13,670 Now we can skip the two string method because we already have the uncoupling method of using UTF. 24 00:02:14,190 --> 00:02:19,230 So if we run the program again, you can see these are also words instead of the. 25 00:02:20,040 --> 00:02:23,550 Next, we are going to create a right stream to write a file. 26 00:02:23,740 --> 00:02:32,760 So we at the constant of white screen is equal to stop create Lifestream and then we create a file name 27 00:02:32,760 --> 00:02:34,890 of white stream text. 28 00:02:35,130 --> 00:02:41,170 And then out here we can type white three dot right and back row slash. 29 00:02:41,720 --> 00:02:46,670 And at last we are going to write stream. 30 00:02:47,660 --> 00:02:48,000 Right. 31 00:02:48,000 --> 00:02:48,550 That's wrong. 32 00:02:49,230 --> 00:02:56,880 So now if we run the program by using looked at now you can see there is a white stream text here and 33 00:02:56,910 --> 00:03:00,530 a neutron and also the task inside this file. 34 00:03:00,840 --> 00:03:04,860 And at last we are going to take a look on the stream top pipe. 35 00:03:05,610 --> 00:03:10,580 And this Mafa used to take readable stream and connect it to writable stream. 36 00:03:10,950 --> 00:03:15,080 And this is a shorter way to do this same thing. 37 00:03:15,390 --> 00:03:20,250 So we can combine this and we just need to use which stream, right? 38 00:03:20,640 --> 00:03:22,360 Top pipe and white stream. 39 00:03:22,590 --> 00:03:24,870 Now, if we delete the text file again. 40 00:03:27,090 --> 00:03:36,300 And run the program and you can see the roistering file created again and all the tests are copied from 41 00:03:36,300 --> 00:03:40,740 the last tests and to the right stream text file.