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.

CORE API / CATATAN</>
Core API09 Jun 2008

How do I sort strings using Collator class?

In this example we demonstrate how to use the java.text.Collator class to sort strings in language-specific order. Using the java.text.Collator class makes the string not just sorted by the ASCII code of their characters, but it will follow the language natural order of the characters. package org.kodejava.text; import java.util.List; import java.util.ArrayList; import java.util.Locale; import java.text.Collator; […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API06 Jun 2008

How do I convert ResourceBundle to Properties?

package org.kodejava.util; import java.util.*; public class ResourceBundleToProperties { public static void main(String[] args) { // Load resource bundle Messages_en_GB.properties from the classpath. ResourceBundle resource = ResourceBundle.getBundle("Messages", Locale.UK); // Call the convertResourceBundleToProperties method to convert the resource // bundle into a Properties object. Properties properties = convertResourceBundleToProperties(resource); // Print the entire con...

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API06 Jun 2008

How do I convert ResourceBundle to Map?

The following code snippet will convert a resource bundle into a map object, a key-value mapping. It will read from a file called Messages_en_GB.properties which corresponding to the Locale.UK. For example the file contain the following string. This file should be placed under the resources directory. welcome.message = Hello World! package org.kodejava.util; import java.util.*; public […]

Wayan · 2 menit baca
ZIP AND GZIP / CATATAN</>
Zip and GZIP02 Jun 2008

How do I decompress Java objects?

In the previous example How do I compress Java objects? we have manage to compress Java objects and stored them in file. In this example we will read the file and reconstruct the compressed objects. For the User class you can see in the previous example mentioned above. package org.kodejava.util.zip; import org.kodejava.util.support.User; import java.io.File; import […]

Wayan · 1 menit baca
ZIP AND GZIP / CATATAN</>
Zip and GZIP30 Mei 2008

How do I compress Java objects?

This example demonstrates how to compress a Java object. We compress the Java object using GZIPOutputStream, pass it to ObjectOutputStream to write the object into an external file. The object we are going to compress will be represented by the User object. We need to make the User object serializable, so it must implement the […]

Wayan · 2 menit baca
ZIP AND GZIP / CATATAN</>
Zip and GZIP27 Mei 2008

How do I read a zip file checksum value?

package org.kodejava.util.zip; import java.io.*; import java.util.zip.ZipInputStream; import java.util.zip.ZipEntry; import java.util.zip.CheckedInputStream; import java.util.zip.Adler32; public class UnzipWithChecksum { public static void main(String[] args) throws Exception { String zipName = "data-1.zip"; try (FileInputStream fis = new FileInputStream(zipName); // Creating input stream that also maintains the checksum of // the data which later can be used to validate data...

Wayan · 1 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.