Understanding Java Writer Class

In  this  tutorial ,  We  will learn  about  writer Class  in  java. Writer  is an abstract  class  that  defines  streaming  character  output. All  of the methods in this  class return  a void value  and  throw  an  IOException  in the  case  of errors. The ‘Writer’ class  provides  a common set  of methods for writing  character  data …

Understanding Java Writer Class Read More »

Detect number of pages in a PDF file using Java

Detect number of pages in a PDF file using Java To detect the number of pages in a PDF file using Java, we’ll use Apache PDFBox. You can get PDFBox from Maven Central. Maven Dependency for PDFBox <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox</artifactId> <version>2.0.24</version> </dependency> Java Code to Get Number of Pages using PDFBox. import org.apache.pdfbox.pdmodel.PDDocument; import java.io.File; …

Detect number of pages in a PDF file using Java Read More »

Reader read() method in Java with Examples

The ‘read()’ method is used to read a single character from an input stream. This method belongs to classes that implement the ‘Reader’ abstract class or its subclasses. read() method in java The ‘read()’ method in java reads a single character from an input stream, returning its Unicode value as an integer. If the end of the …

Reader read() method in Java with Examples Read More »

How to flatten a stream using flatMap() method in Java

Hey, Coders! In this tutorial, we are going to learn about flatten a stream using the flatMap() method in Java. map(): It transforms each stream element into a single element of a new stream. flatMap(): It transforms each stream element into a stream of multiple elements. Flattening: It is the process of converting two or …

How to flatten a stream using flatMap() method in Java Read More »

Scroll to Top