ByteArrayInputStream in Java

ByteArrayInputStream class in Java ByteArrayInputStream class in Java reads an array of bytes as a stream. It contains both ByteArray and InputStream. The ByteArrayInputStream class is a subclass of InputStream class. Internally, it has a buffer, that reads an array of bytes as a stream. It is part of the …

Read more

Map.Entry in Java

Map.Entry in Java is an interface in Java that enables us to access the entries within a map. It is a nested interface within the Map interface and hence we use it as Map.Entry. In this tutorial, we will discuss the Map.Entry Interface in Java with examples using its various …

Read more

Java regex

In this tutorial, we will discuss what is a Java Regular expression and how to use java substring regex for pattern matching using the pattern.matcher along with different examples. We will also cover various java regex special characters that we use for java pattern matches. What is a Regular expression …

Read more

StringBuilder Java

StringBuilder in Java StringBuilder class in Java is used to manipulate strings so that we can modify the value. In other, StringBuilder class is mutable. It is similar to StringBuffer and String class except that this is mutable whereas StringBuffer is immutable. The performance of StringBuilder is faster than StringBuffer …

Read more

StringBuffer in Java

StringBuffer class in Java The StringBuffer in Java is a class that we can use to manipulate Strings. Strings are immutable which means it is of fixed length whereas StringBuffer is mutable and growable meaning we can change the length of string and do different manipulations like append, delete, insert, …

Read more

Java Stack Example

What is a Java Stack class? A Java stack class implementation is based on the stack data structure. It follows the concept of the Last-In-First-Out(LIFO) concept which means the element that we insert last will be removed first. In other words, we can delete elements only from the top of …

Read more

FileReader Java

FileReader in Java FileReader in Java is a class that we use to read data from a file. It is character-oriented and returns data in the form of bytes. This class is part of the java.io package and extends the InputStreamReader class. Java FileReader constructors The FileReader class supports two …

Read more

FileWriter in Java

Java FileWriter How to write to a file in java? – FileWriter in Java is a class that we use to write data in the form of characters to a file. It extends the OutputStream class and writes a stream of characters. The java.io package includes the FileWriter class Java …

Read more

DataOutputStream in Java

What is Java DataOutputStream The DataOutputStream class in Java allows us to write primitive data type values to an output stream. This operation is machine-independent and portable. We can use any output stream class like FileOutputStream which is an argument to the DataOutputStream constructor. DataOutputStream dos = new DataOutputStream(OutputStream out); …

Read more

Translate ยป