SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

IO / NOTES</>↗
IO05 Jan 2026

How do I use memory mapped files with FileChannel.map()?

Using FileChannel.map() allows you to map a region of a file directly into memory. This creates a MappedByteBuffer, which acts like a bridge between your application’s memory and the file on disk. The operating system handles the actual reading and writing in the background, making it extremely efficient for large files. Here is how you […]

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

How do I use ObjectOutputStream with record?

To use ObjectOutputStream with a Java record, you need to make the record implement the java.io.Serializable interface. One of the great things about records is that they are designed to be “data carriers,” and Java’s serialization mechanism handles them more robustly and securely than regular classes. Specifically, records are serialized using only their components (the […]

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

How do I serialize and deserialize objects safely?

In a modern Java environment, “safely” means avoiding the pitfalls of standard Java Serialization, which is often vulnerable to gadget attacks and remote code execution. Here are the best practices for safe serialization and deserialization: 1. Prefer Data-Only Formats (JSON/XML) Instead of standard Java serialization, use JSON with a library like Jackson (already common in […]

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

How do I use ByteBuffer to process binary files?

Using ByteBuffer to process binary files is a core part of Java NIO (New I/O). It provides a more efficient way to handle raw bytes compared to traditional stream-based I/O by allowing direct interaction with memory and OS-level optimizations. Here is a guide on how to effectively use ByteBuffer for binary file processing. 1. The […]

Wayan · 3 min read
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
✳

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.