Hey, and welcome back. Scott Stanlick here. In these lessons, we're gonna take a look at file input/output. And we'll see how to read files, write files, obtain metadata about files. So I wanna start off my just saying that in Java, you have the capability of reading and writing byte streams, which are eight-bit characters or character streams, which are Unicode 16-bit characters, and there's bridging built in to transition between byte streams and character streams or character streams to byte streams. And there are many, many different ways that you can read content in. But for data print streams, piped, channels, byte arrays, string buffers, object input streams, the list is lengthy. There's probably just about anything possible that you would need to do with respect to reading or writing files, I/O. So the first thing we're gonna look at is reading a small file using this new I/O library, and we have a file, this happens to be a Java file actually that we are going to read. We're gonna use the Files class, readAllLines method, pass it the path and give it the character set, which this is UTF-8. So if we run this first test, I get a stream and I'm going to say for each line in the stream or for each element in the stream, print it out. So we can see here, sure enough, that looks like the file, FileReadWriteFun, so there's the file that we're reading. The next one shows us a technique that we can use to not read all the lines in and because if you had a monster file, like huge, very large file, you may not have enough memory to read all the lines. So there's another behavior on the Files class called Lines that will actually do just that. You stream and as you're reading the lines here, only bits of the file are loaded into memory at a time. So it's much more memory efficient. You accomplish the same thing as we will see here. I'm still going to read the entire file. But you read it in chunks as opposed to reading the entire file into memory. So same output, same content, same result rather. It's just a much more memory-efficient way of reading pieces of a file in as opposed to the whole thing. And the last read we're gonna look at is a data input stream where we have control over each and every byte that we read in as opposed to reading lines or all the lines. Well, the approach that is being used here is we're going to find out how many bytes are available on the reader given that path. And we're going to create a byte array here and read all the bytes into that byte array. And then print the contents of the byte array out as a string. So let's see. This should result in the same output. It sure does. So I appreciate you watching. Thank you very much.