Class PipedAudioStream.Group

java.lang.Object
java.io.OutputStream
org.openhab.core.audio.PipedAudioStream.Group
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Enclosing class:
PipedAudioStream

public static class PipedAudioStream.Group extends OutputStream
The PipedAudioStream.Group is an OutputStream implementation that can be use to create one or more PipedAudioStream instances and write to them at once. The created PipedAudioStream instances are removed from the group when closed.
  • Constructor Details

    • Group

      protected Group(AudioFormat format, int pipeSize)
  • Method Details

    • getAudioStreamInGroup

      public PipedAudioStream getAudioStreamInGroup() throws IOException
      Creates a new PipedAudioStream connected to the group. The stream unregisters itself from the group on close.
      Returns:
      a new PipedAudioStream to pipe data written to the group
      Throws:
      IOException - when unable to create the stream
    • isEmpty

      public boolean isEmpty()
      Returns true if this group has no streams connected.
      Returns:
      true if this group has no streams connected
    • size

      public int size()
      Returns the number of streams connected.
      Returns:
      the number of streams connected
    • write

      public void write(byte @Nullable [] b, int off, int len)
      Overrides:
      write in class OutputStream
    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte @Nullable [] bytes)
      Overrides:
      write in class OutputStream
    • flush

      public void flush()
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream