Additional Java SE Packages

Externalizable

Externalizable is an interface in Java (part of java.io) that gives the programmer complete control over the serialization process. Unlike Serializable, where Java handles serialization automatically, Externalizable requires the class to explicitly implement how the object’s state is written and read. Interface Definition Simple Program: Custom Serialization Using Externalizable LotusJavaPrince wants to store Mahesh’s login …

Externalizable Read More »

OutputStreamWriter

OutputStreamWriter is a bridge from character streams to byte streams. It encodes character data into bytes using a specified charset and writes them to an underlying byte stream (like FileOutputStream,Socket.getOutputStream()). It is typically used when you need to write character data to a destination that only supports byte streams. Commonly Used Constructors and Methods Simple …

OutputStreamWriter Read More »

InputStreamReader

InputStreamReader is a bridge from byte streams to character streams. It reads bytes from an underlying InputStream and decodes them into characters using a specified charset (encoding). This is essential for reading text data from byte-based input sources like files, network connections, or system input (keyboard). Commonly Used Constructors and Methods Simple Program: Reading Console …

InputStreamReader Read More »

BufferedWriter

BufferedWriter is a wrapper class around another Writer class (like FileWriter) that buffers output characters to provide efficient writing of characters, arrays, and strings. It reduces the number of physical write operations by buffering data internally, improving performance, especially when writing large text files or multiple small writes. Commonly Used Constructors and Methods Simple Program: …

BufferedWriter Read More »

BufferedReader

BufferedReader is a wrapper class around another Reader class (like FileReader or InputStreamReader) that buffers input to provide efficient reading of characters, arrays, and lines. It improves performance by minimizing the number of I/O operations, especially useful for reading text files line by line. Commonly Used Constructors and Methods Simple Program: Read File Line-by-Line Using …

BufferedReader Read More »

PrintStream

PrintStream is a subclass of FilterOutputStream that adds functionality for printing various data values in human-readable text format. It’s commonly used for printing output to the console, files, or any other output stream. Automatically converts primitives and objects to string representation. Methods like print(), println(), and printf() are provided. You can control whether to auto-flush …

PrintStream Read More »

Scroll to Top