Writing and reading structured data - feature image

Java files, part 5: Writing and reading structured data: DataOutputStream, DataInputStream

In the first four parts of this article series, we covered reading and writing files, directory and file path construction, and directory and file operations. Up to now, we have only read and written byte arrays and Strings. In this fifth part, you will learn how to write and read structured data with DataOutputStream, DataInputStream, …

Java files, part 5: Writing and reading structured data: DataOutputStream, DataInputStream Read More »

Listing directory contents, moving, copying, deleting files - feature image

Java files, part 4: Listing directory contents / Moving, copying, deleting files

Previous articles in this series have covered reading files with Java, writing files, and constructing directory and file paths with the File and Path classes. This fourth part describes the most important directory and file operations. It answers the following questions: How to list all files in a directory? How to search for files matching …

Java files, part 4: Listing directory contents / Moving, copying, deleting files Read More »

Java files - constructing file and directory names with File, Path, Paths - Feature image

Java files, part 3: Constructing file and directory names (with File, Path, and Paths)

After covering file reading and writing operations in Java, this third part of the series of articles deals with how to use the classes File, Path, and Paths to construct file and directory paths – regardless of the operating system. If you have already dealt with file operations in Java, you have probably used these …

Java files, part 3: Constructing file and directory names (with File, Path, and Paths) Read More »