Interface IBinaryStreamsProxy

All Superinterfaces:
IStreamsProxy, IStreamsProxy2

public interface IBinaryStreamsProxy extends IStreamsProxy2
A variant of IStreamsProxy which does not touch the proxied content and pass it as bytes instead of strings.

A streams proxy acts as proxy between the streams of a process and interested clients. This abstraction allows implementations of IProcess to handle I/O related to the standard input, output, and error streams associated with a process.

Clients implementing the IProcess interface for a process which produce or consumes binary content should consider to implement this interface instead of just IStreamsProxy.

Since:
3.16
See Also:
  • Method Details

    • getBinaryErrorStreamMonitor

      IBinaryStreamMonitor getBinaryErrorStreamMonitor()
      Returns a monitor for the error stream of this proxy's process, or null if not supported.

      The monitor is connected to the error stream of the associated process.

      In contrast to IStreamsProxy.getErrorStreamMonitor() which will decode the stream content to strings, the IBinaryStreamMonitor will provide the raw stream data.

      Returns:
      an error stream monitor, or null if none
    • getBinaryOutputStreamMonitor

      IBinaryStreamMonitor getBinaryOutputStreamMonitor()
      Returns a monitor for the output stream of this proxy's process, or null if not supported.

      The monitor is connected to the output stream of the associated process.

      In contrast to IStreamsProxy.getOutputStreamMonitor() which will decode the stream content to strings, the IBinaryStreamMonitor will provide the raw stream data.

      Returns:
      an output stream monitor, or null if none
    • write

      default void write(byte[] data) throws IOException
      Writes the given data to the output stream connected to the standard input stream of this proxy's process.
      Parameters:
      data - the data to be written
      Throws:
      IOException - when an error occurs writing to the underlying OutputStream.
    • write

      void write(byte[] data, int offset, int length) throws IOException
      Writes the given data to the output stream connected to the standard input stream of this proxy's process.
      Parameters:
      data - the data to be written
      offset - start offset in the data
      length - number of bytes to write
      Throws:
      IOException - when an error occurs writing to the underlying OutputStream.