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.

APACHE COMMONS / NOTES</>↗
Apache Commons01 Sep 2008

How do I decode a Base64 encoded binary?

package org.kodejava.commons.codec; import org.apache.commons.codec.binary.Base64; import java.util.Arrays; public class Base64Decode { public static void main(String[] args) { String hello = "SGVsbG8gV29ybGQ="; // Decode a previously encoded string using decodeBase64 method and // passing the byte[] of the encoded string. byte[] decoded = Base64.decodeBase64(hello.getBytes()); // Print the decoded array System.out.println(Arrays.toString(decoded)); // Convert the decoded byt...

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons28 Aug 2008

How do I encode binary data as Base64 string?

package org.kodejava.commons.codec; import org.apache.commons.codec.binary.Base64; import java.util.Arrays; public class Base64Encode { public static void main(String[] args) { String hello = "Hello World"; // The encodeBase64 method take a byte[] as the parameter. The byte[] // can be from a simple string like in this example, or it can be from // an image file data. byte[] […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API24 Aug 2008

How do I convert java.util.Set into Array?

package org.kodejava.util; import java.util.*; public class SetToArray { public static void main(String[] args) { // Create a java.util.Set object and add some integers into the Set. Set<Integer> numberSet = new HashSet<>(); numberSet.add(1); numberSet.add(2); numberSet.add(3); numberSet.add(5); numberSet.add(8); // Converting a java.util.Set into an array can be done by creating a // java.util.List object from the Set […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API23 Aug 2008

How do I convert Set into List?

The code below gives you an example of converting a java.util.Set into a java.util.List. It has simply done by creating a new instance of List and pass the Set as the argument of the constructor. package org.kodejava.util; import java.util.*; public class SetToList { public static void main(String[] args) { // Create a Set and add […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API20 Aug 2008

How do I convert Properties into Map?

package org.kodejava.util; import java.util.Properties; import java.util.Map; import java.util.HashMap; import java.util.Set; public class PropertiesToMap { public static void main(String[] args) { // Create a new instance of Properties. Properties properties = new Properties(); // Populate properties with a dummy application information properties.setProperty("app.name", "HTML Designer"); properties.setProperty("app.version", "1.0"); properties.setProperty("app.vendor", "HTM...

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons16 Aug 2008

How do I sort files based on their last modified date?

This example demonstrates how to use Apache Commons IO LastModifiedFileComparator class to sort files based on their last modified date in ascending and descending order. There are two comparators defined in this class, the LASTMODIFIED_COMPARATOR and the LASTMODIFIED_REVERSE. package org.kodejava.commons.io; import static org.apache.commons.io.comparator.LastModifiedFileComparator.*; import java.io.File; import java.util.Arrays; public class FileSortLastModified { public sta...

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.