DataInputStream in Java

DataInputStream in Java Java DataInputStream is a class that we use to read primitive data type values. We can use this stream along with other input streams like FileInputStream to read the data. Since it reads data as numbers instead of bytes, we call it as DataInputStream. It contains only …

Read more

BufferedOutputStream in Java

BufferedOutputStream in Java BufferedOutputStream is a class in Java which we can use to write data into the output stream. It uses a buffer to write data instead of directly writing into the file. We can use the FileOutputStream class along with the BufferedOutputStream to write information to the file. …

Read more

BufferedInputStream in Java

BufferedInputStream in Java BufferedInputStream is a class in Java which we can use to read data from a file stream. We can use FileInputStream as the input stream along with the BufferedInputStream. It uses the concept of a buffer where it creates a buffer array whenever we create a BufferedInputStream. …

Read more

FileInputStream in Java

FileInputStream in Java The FileInputStream class in Java extends the InputStream class. We use this class to read data in the form of bytes from a file. For example, we can use the FileInputStream to read an image, pdf file, audio, video. Hierarchy Constructors The FileInputStream in Java has the …

Read more

FileOutputStream in Java

FileOutputStream class in Java FileOutputStream is a class in Java that we use to write data into a file. We can either write byte-oriented or character-oriented data. The FileOutputStream class extends the OutputStream and we mainly use it to write primitive values. This is part of the java.io package. We …

Read more

File handling in Java

Java Files and directories File handling in Java – Files in Java is a class that is part of the java.io package which we use to perform different operations on files. A file is a repository that stores information. For example, the .java file that we create is a file …

Read more

Wrapper class in Java

Java Wrapper class Wrapper class in Java converts or wraps primitive data types as objects. This means we can convert primitive values into objects and vice versa. There are 8 primitive data types which have an equivalent wrapper class. These wrapper classes extend the Number class which is the parent …

Read more

PriorityBlockingQueue in Java

PriorityBlockingQueue in Java The PriorityBlockingQueue is a class in Java that implements the BlockingQueue interface and extends the AbstractQueue class. It implements the concurrent BlockingQueue data structure. The working of a PriorityBlockingQueue is similar to a PriorityQueue but enforces a blocking retrieval operation. This means when we try to add …

Read more

ArrayDeque in Java

ArrayDeque in Java The ArrayDeque is a class in Java that implements the Deque and Queue interface. This is a special class that implements a double-ended queue data structure where it can insert and remove elements from both ends. It supports in implementation of a resizable array that grows automatically. …

Read more

Deque in Java

Deque interface in Java Deque in Java is an interface that extends the queue interface. It stands for the double-ended queue which means we can insert and delete elements from both sides. It supports both queue implementation which is First-In-First-Out(FIFO) and stack implementation which is Last-In-First-Out(LIFO). Deque interface is part …

Read more

Translate ยป