SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

IO / NOTES</>↗
IO03 Jan 2026

How do I use FileChannel for efficient file IO?

Using FileChannel from the java.nio.channels package is a powerful way to perform high-performance file operations. It allows for advanced features like memory-mapped files and direct transfer between channels, which are often much faster than traditional stream-based I/O. Here are the most efficient ways to use FileChannel. 1. Fast File Copying with transferTo or transferFrom This […]

Wayan · 3 min read
IO / NOTES</>↗
IO03 Jan 2026

How do I use Files.probeContentType() to detect file type?

To use Files.probeContentType(Path path) in Java, you simply pass a Path object to the method. It returns a string representing the MIME type (e.g., image/png, text/plain) or null if the type cannot be determined. Here is a practical example of how to implement it: package org.kodejava.nio; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public […]

Wayan · 2 min read
IO / NOTES</>↗
IO02 Jan 2026

How do I zip and unzip files with Java I/O?

In Java, handling ZIP files is primarily done using the java.util.zip package. The key classes you’ll use are ZipOutputStream for creating (zipping) files and ZipInputStream (or ZipFile) for extracting (unzipping) them. Here is a breakdown of how to perform both operations. 1. Zipping Files To zip files, you wrap a FileOutputStream with a ZipOutputStream. For […]

Wayan · 3 min read
IO / NOTES</>↗
IO02 Jan 2026

How do I use Files.walk() to traverse directories?

To use Files.walk to traverse directories, you call the method with a starting Path. It returns a Stream<Path> that lazily populates as you traverse the file tree in a depth-first manner. The most important best practice when using Files.walk is to use it within a try-with-resources block. This ensures that the underlying resources (the directory […]

Wayan · 2 min read
IO / NOTES</>↗
IO01 Jan 2026

How do I create a temporary file with Files.createTempFile()?

To create a temporary file using java.nio.file.Files.createTempFile, you can use one of two main overloaded methods. This is part of the Java NIO.2 API and is generally preferred over the older File.createTempFile because it returns a Path object and allows for better error handling and file attributes. 1. In the Default Temporary Directory If you […]

Wayan · 2 min read
IO / NOTES</>↗
IO01 Jan 2026

How do I use Files.lines() to process a text file line by line?

To use Files.lines() to process a text file line by line in Java, you should follow the pattern of returning a Stream<String> within a try-with-resources block. This approach is memory-efficient because it reads the file lazily, meaning it doesn’t load the entire file into memory at once. Basic Implementation package org.kodejava.nio; import java.io.IOException; import java.nio.file.Files; […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.