Class FilteredInputStream

java.lang.Object
java.io.InputStream
com.cloudbees.jenkins.support.filter.FilteredInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class FilteredInputStream extends InputStream
A custom InputStream that filters lines of text read from an underlying InputStream using a provided mapping function. Each line read from the input stream is processed by the function before being returned, allowing for modifications such as redaction or transformation of the line content.
Author:
Basil Crow
  • Constructor Details

    • FilteredInputStream

      public FilteredInputStream(@NonNull InputStream is, @NonNull Charset encoding, @NonNull Function<String,String> filter)
      Constructs a filtered stream using the provided filter and encoding.
      Parameters:
      is - Input stream to read line content from
      encoding - Character set to use for decoding and encoding bytes read from this stream
      filter - Filter to apply to lines read from this stream
  • Method Details