Loading...

Java I/O File Handling - Locating the Resource: File (Java IO) vs Path (Java NIO2)

432 27________

In today’s video, we’re going to review together Java IO API. As you’ve already known, I/O here means input and output, more specifically, read from a resource into a java application and write from a java application out to a resource. A resource could be a disk, filesystem, network, etc,…

There are two main concepts in Java I/O:
first, we need to know where the file is and its characteristic like its name, it exists or not, it’s a folder or file,...
Second, then, we can read or write from/to this file.

Github: github.com/nlinhvu/java-io-demo-2024

Java We Knew 101 Series:    • Java We Knew 101  

References:
Understanding the Main Java I/O Concepts in dev.java: dev.java/learn/java-io/intro/
Accessing Resources using Paths in dev.java: dev.java/learn/java-io/file-system/file-path/
Working with Paths in dev.java: dev.java/learn/java-io/file-system/path/

(00:00): Introduction
(02:44): History
(06:44): Path (Java NIO2) vs File (Java I/O)
(09:44): Refactor File to Path
(10:18): Methods to manipulate File
(15:10): Corresponding methods to manipulate Path
(21:08): Confirm that File methods do not scale
(24:42): Limit the maximum memory of JVM to 16MB by -Xmx16m
(27:27): Remember to close DirectoryStream

コメント