FilterInputStream
FilterInputStream is a class in the Java I/O library that provides a simple framework for wrapping an existing InputStream to apply filtering or transformations to the data as it is read. It is a concrete subclass of InputStream and is designed to be extended by concrete filter implementations.
The core idea is delegation: FilterInputStream delegates most of its methods to the underlying stream, which
By itself, FilterInputStream does not add significant processing; it serves as a base class for building more
Key behavior is that most methods—read, skip, available, close, mark, and reset—delegate to the wrapped stream
Related concepts include FilterOutputStream, which provides a counterpart for OutputStream, and the broader decorator design pattern.