Package org.openhab.core.audio
Class PipedAudioStream.Group
java.lang.Object
java.io.OutputStream
org.openhab.core.audio.PipedAudioStream.Group
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Enclosing class:
PipedAudioStream
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Creates a newPipedAudioStreamconnected to the group.booleanisEmpty()Returns true if this group has no streams connected.intsize()Returns the number of streams connected.voidwrite(byte @Nullable [] bytes) voidwrite(byte @Nullable [] b, int off, int len) voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
Group
-
-
Method Details
-
getAudioStreamInGroup
Creates a newPipedAudioStreamconnected to the group. The stream unregisters itself from the group on close.- Returns:
- a new
PipedAudioStreamto 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:
writein classOutputStream
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte @Nullable [] bytes) - Overrides:
writein classOutputStream
-
flush
public void flush()- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-