Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

APACHE COMMONS / CATATAN</>
Apache Commons12 Mei 2006

How do I calculate directory size?

In this example, we are going to use the Apache Commons IO library to get or calculate the total size of a directory. The FileUtils class provided by the Commons IO can help us to achieve this goal. The first method that we can use is the FileUtils.sizeOfDirectory(), it calculates the size of a directory […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons05 Mei 2006

How do I read file contents to string using Commons IO?

In this example we use FileUtils class from Apache Commons IO to read the content of a file. FileUtils have two static methods called readFileToString(File) and readFileToString(File, String) that we can use. An example to read file contents and return the result as a string can be seen below. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; […]

Wayan · 1 menit baca
ZIP AND GZIP / CATATAN</>
Zip and GZIP05 Mei 2006

How do I read entries in a zip / compressed file?

package org.kodejava.util.zip; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class ZipFileExample { public static void main(String[] args) { try { // Create an instance of ZipFile to read a zip file // called sample.zip ZipFile zip = new ZipFile(new File("data.zip")); // Here we start to iterate each […]

Wayan · 2 menit baca
BASIC / CATATAN</>
Basic04 Mei 2006

What is Autoboxing?

Autoboxing is a new feature offered in the Tiger (1.5) release of Java SDK. In short auto boxing is a capability to convert or cast between object wrappers (Integer, Long, etc) and their primitive types. Previously when placing primitive data into one of the Java Collection Framework object we have to wrap it to an […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API03 Mei 2006

How do I use Java NIO to copy file?

The following code snippet show you how to copy a file using the NIO API. The NIO (New IO) API is in the java.nio.* package. It requires at least Java 1.4 because the API was first included in this version. The JAVA NIO is a block based IO processing, instead of a stream based IO […]

Wayan · 2 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.