de.caff.util.debug

## Class DebuggingOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - de.caff.util.debug.DebuggingOutputStream

- All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

      public class DebuggingOutputStream
      extends java.io.OutputStream

  An OutputStream, which sends all output to the debugging interface. Used to capture the standard streams from System.
  Author:
    Rammi
  See Also:
    `Debug`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static int` | `STDERR` Constant for the stderr stream.
    `(package private) static int` | `STDOUT` Constant for the stdout stream

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DebuggingOutputStream(int dir)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close stream.
    `void` | `flush()` Flush stream.
    `void` | `write(byte[] b)` Write a byte array.
    `void` | `write(byte[] b, int off, int len)` Write a part of a byte array.
    `void` | `write(int b)` Write a byte.

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

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

- - ### Field Detail

    - #### STDOUT

          static final int STDOUT

      Constant for the stdout stream
      See Also:
        Constant Field Values

    - #### STDERR

          static final int STDERR

      Constant for the stderr stream.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DebuggingOutputStream

          DebuggingOutputStream(int dir)

      Constructor.
      Parameters:
        `dir` - `STDOUT` or `STDERR`

  - ### Method Detail

    - #### close

          public void close()

      Close stream. Does nothing.
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `java.io.OutputStream`

    - #### flush

          public void flush()

      Flush stream. Does nothing.
      Specified by:
        `flush` in interface `java.io.Flushable`
      Overrides:
        `flush` in class `java.io.OutputStream`

    - #### write

          public void write(int b)

      Write a byte.
      Specified by:
        `write` in class `java.io.OutputStream`
      Parameters:
        `b` - the byte

    - #### write

          public void write(@NotNull
                            byte[] b)

      Write a byte array.
      Overrides:
        `write` in class `java.io.OutputStream`
      Parameters:
        `b` - the byte array

    - #### write

          public void write(@NotNull
                            byte[] b,
                            int off,
                            int len)

      Write a part of a byte array.
      Overrides:
        `write` in class `java.io.OutputStream`
      Parameters:
        `b` - the byte array
        `off` - start offset to first byte to be written
        `len` - number of bytes to write