java.io and java.nio

IntBuffer

IntBuffer is a class from the java.nio package in Java that allows you to work efficiently with sequences of 32-bit signed integers. It is part of the NIO (New I/O) library and supports buffer-based data manipulation useful for I/O operations, communication protocols, and performance-critical applications.IntBuffer is abstract; you create an instance using static factory methods …

IntBuffer Read More »

ShortBuffer

ShortBuffer is part of the java.nio package and provides a buffer for manipulating 16-bit short integers. It is useful in low-level I/O tasks, such as binary data processing, communication protocols, and memory-mapped files.ShortBuffer is an abstract class; instances are created using the allocate() or wrap() static methods. Commonly Used Methods Simple Program using ShortBuffer(Storing and …

ShortBuffer Read More »

CharBuffer

CharBuffer is part of the java.nio package and is a buffer for handling characters. It is useful for character-based input/output operations, such as text parsing, network communication, or file processing. It works similarly to ByteBuffer but specifically stores 16-bit char values. Commonly Used Methods Simple Program using CharBuffer Writing and Reading Characters Problem Statement: LotusJavaPrince …

CharBuffer Read More »

Buffer classes Heirarchy

Java introduced the New I/O (NIO) package (java.nio) to provide more efficient data handling, especially for large-scale, non-blocking input/output operations. Central to this NIO architecture is the Buffer class and its subclasses, which are used for storing and manipulating data in memory. 1. The Root Class – java.nio.Buffer At the top of the hierarchy is …

Buffer classes Heirarchy Read More »

Console

The Console class in Java (available in the java.io package) provides methods to access the character-based console device — typically, the text terminal from which the user runs the program. It’s useful for reading input and writing output in a secure and interactive way, especially for password input where echoing is disabled. The Console class …

Console Read More »

Scroll to Top