Additional Java SE Packages

Writer

Writer is an abstract class for writing streams of characters in Java. It is the superclass for all classes that write character output, such as FileWriter, BufferedWriter, PrintWriter, etc.It is the character-based counterpart of OutputStream and handles text data efficiently across platforms with Unicode support. Commonly Used Methods Simple Program – Writing to a File …

Writer Read More »

PipedOutputStream

PipedOutputStream is a class in the java.io package used to write data to a communication pipe, where another thread can read the data using a connected PipedInputStream. Together, they form a producer-consumer style inter-thread communication channel. This mechanism is helpful for simulating streaming, pipelines, or in-memory communication between threads without using shared memory or files. …

PipedOutputStream Read More »

Cryptography and Secure Coding Practices

Cryptography is the practice of securing data through encryption and decryption. Java provides robust cryptographic APIs within the javax.crypto and java.security packages, enabling developers to implement secure data transmission, authentication, and integrity checks. Key Concepts in Cryptography: Encryption: Converting plaintext data into an unreadable format (ciphertext). Decryption: Reversing the encryption process to obtain the original …

Cryptography and Secure Coding Practices Read More »

Basics of Handlers

In the java.util.logging package, Handlers are components that take LogRecord objects from a Logger and publish them to a specific destination (console, file, socket, etc.). Commonly Used Handlers Commonly Used Methods Simple Program: Using ConsoleHandler Output: A Handler decides where the logs go: console, file, remote socket, etc.You can attach multiple Handlers to a single …

Basics of Handlers Read More »

Exploring java.util.logging package

The java.util.logging package is Java’s built-in logging API that enables developers to capture runtime information, errors, and system status messages efficiently. Introduced in Java 1.4, it provides a standard mechanism for logging messages from Java applications. Why Use java.util.loggong? The main benefit of java.util.logging is that it is part of the Java standard library. It …

Exploring java.util.logging package Read More »

SLF4J

SLF4J (Simple Logging Facade for Java) is a Java API designed to serve as a simple facade or abstraction for various logging frameworks such as: Log4j Logback java.util.logging (JUL) Apache Commons Logging It allows developers to plug in the desired logging framework at deployment time without modifying the source code. Why Use SLF4J? Decoupling: Your …

SLF4J Read More »

Log4j

Log4j (short for Logging for Java) is a reliable, fast, and flexible logging framework developed by the Apache Software Foundation. It allows developers to log messages according to different severity levels and send those messages to multiple destinations like the console, files, GUI components, databases, or remote servers. Evolution: Log4j 1.x: Original version, now deprecated. …

Log4j Read More »

Scroll to Top