Package de.gebit.integrity.runner.console.intercept

## Class DefaultConsoleOutputInterceptor.InterceptPrintStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.FilterOutputStream
    - - java.io.PrintStream
      - - de.gebit.integrity.runner.console.intercept.DefaultConsoleOutputInterceptor.InterceptPrintStream

- All Implemented Interfaces:
    `Closeable`, `Flushable`, `Appendable`, `AutoCloseable`
  Enclosing class:
    DefaultConsoleOutputInterceptor

      protected class DefaultConsoleOutputInterceptor.InterceptPrintStream
      extends PrintStream

  This stream is the core of this service: it captures all data being printed through it, splits it into single lines and forwards the lines to all targets.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

    - ### Fields inherited from class java.io.FilterOutputStream

      `out`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InterceptPrintStream​(PrintStream aTarget, boolean anStdErrFlag)` | Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `PrintStream` | `append​(char aChar)` |
    `PrintStream` | `append​(CharSequence aSequence)` |
    `PrintStream` | `append​(CharSequence aSequence, int aStart, int anEnd)` |
    `void` | `flushBufferedLine()` | Flushes the current line to the targets, splitting it into single lines in the process.
    `void` | `flushIfNecessary()` | Flushes the current line to the targets, but only if it ends with a newline and can thus be considered "complete".
    `PrintStream` | `format​(String aFormat, Object... someArgs)` |
    `PrintStream` | `format​(Locale aLocale, String aFormat, Object... someArgs)` |
    `void` | `print​(boolean aBoolean)` |
    `void` | `print​(char aChar)` |
    `void` | `print​(char[] someChars)` |
    `void` | `print​(double aDouble)` |
    `void` | `print​(float aFloat)` |
    `void` | `print​(int anInteger)` |
    `void` | `print​(long aLong)` |
    `void` | `print​(Object anObject)` |
    `void` | `print​(String aString)` |
    `PrintStream` | `printf​(String aFormat, Object... someArgs)` |
    `PrintStream` | `printf​(Locale aLocale, String aFormat, Object... someArgs)` |
    `void` | `println()` |
    `void` | `println​(boolean aBoolean)` |
    `void` | `println​(char aChar)` |
    `void` | `println​(char[] someChars)` |
    `void` | `println​(double aDouble)` |
    `void` | `println​(float aFloat)` |
    `void` | `println​(int anInteger)` |
    `void` | `println​(long aLong)` |
    `void` | `println​(Object anObject)` |
    `void` | `println​(String aLine)` |
    `void` | `write​(byte[] someBytes, int anOffset, int aLength)` |
    `void` | `write​(int aByte)` |

    - ### Methods inherited from class java.io.PrintStream

      `checkError, clearError, close, flush, setError`

    - ### Methods inherited from class java.io.FilterOutputStream

      `write`

    - ### Methods inherited from class java.io.OutputStream

      `nullOutputStream`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InterceptPrintStream

          public InterceptPrintStream​(PrintStream aTarget,
                                      boolean anStdErrFlag)

      Creates a new instance.
      Parameters:
        `aTarget` - the actual stream which is to receive everything
        `anStdErrFlag` - whether this stream is used to intercept stderr

  - ### Method Detail

    - #### flushBufferedLine

          public void flushBufferedLine()

      Flushes the current line to the targets, splitting it into single lines in the process. This does not flush if the line is entirely empty, but it will flush incomplete lines as well.

    - #### flushIfNecessary

          public void flushIfNecessary()

      Flushes the current line to the targets, but only if it ends with a newline and can thus be considered "complete".

    - #### println

          public void println​(String aLine)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println()

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(Object anObject)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(boolean aBoolean)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(char aChar)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(char[] someChars)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(double aDouble)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(float aFloat)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(int anInteger)

      Overrides:
        `println` in class `PrintStream`

    - #### println

          public void println​(long aLong)

      Overrides:
        `println` in class `PrintStream`

    - #### print

          public void print​(String aString)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(char aChar)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(double aDouble)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(boolean aBoolean)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(int anInteger)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(long aLong)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(Object anObject)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(char[] someChars)

      Overrides:
        `print` in class `PrintStream`

    - #### print

          public void print​(float aFloat)

      Overrides:
        `print` in class `PrintStream`

    - #### printf

          public PrintStream printf​(String aFormat,
                                    Object... someArgs)

      Overrides:
        `printf` in class `PrintStream`

    - #### printf

          public PrintStream printf​(Locale aLocale,
                                    String aFormat,
                                    Object... someArgs)

      Overrides:
        `printf` in class `PrintStream`

    - #### format

          public PrintStream format​(Locale aLocale,
                                    String aFormat,
                                    Object... someArgs)

      Overrides:
        `format` in class `PrintStream`

    - #### format

          public PrintStream format​(String aFormat,
                                    Object... someArgs)

      Overrides:
        `format` in class `PrintStream`

    - #### append

          public PrintStream append​(char aChar)

      Specified by:
        `append` in interface `Appendable`
      Overrides:
        `append` in class `PrintStream`

    - #### append

          public PrintStream append​(CharSequence aSequence)

      Specified by:
        `append` in interface `Appendable`
      Overrides:
        `append` in class `PrintStream`

    - #### append

          public PrintStream append​(CharSequence aSequence,
                                    int aStart,
                                    int anEnd)

      Specified by:
        `append` in interface `Appendable`
      Overrides:
        `append` in class `PrintStream`

    - #### write

          public void write​(int aByte)

      Overrides:
        `write` in class `PrintStream`

    - #### write

          public void write​(byte[] someBytes,
                            int anOffset,
                            int aLength)

      Overrides:
        `write` in class `PrintStream`