Convert InputStream to BufferedReader in Java
The BufferedReader reads characters; while the InputStream is a stream of bytes. The BufferedReader can’t read the InputStream directly; So, we need to use an adapter like InputStreamReader to convert…
Favourite tutorials for developers
The BufferedReader reads characters; while the InputStream is a stream of bytes. The BufferedReader can’t read the InputStream directly; So, we need to use an adapter like InputStreamReader to convert…
This article shows four ways to copy a file in Java: (1) Files.copy (NIO), (2) Apache Commons IO, (3) Guava, (4) Plain Java. In Java 7+, the NIO Files.copy is…
In Java, we can use Files.readAttributes() to get the file metadata or attribute, and then lastModifiedTime() to display the last modified date of a file. For legacy IO, we can…
A collection of Java date and time examples.
In Java, we can use String.contains() to check if a String contains a substring. We can also check the substring by using indexOf().
In this article, we will examine some example to convert String to Char array vise verse.
In Java, we use StringTokenizer to split a string into multiple tokens. The StringTokenizer is a legacy class, try the split method of String.
This article shows you how to use the JDK1.5 String.format() and Apache Common Lang to left or right pad a String in Java.
This article shows you how to format a string in Java, via String.format(). We will examine how to control String format with argument, how to format Integer, Floating Points as…
In Java, we can use DateTimeFormatter to convert the FileTime to other custom date formats.