Package org.openhab.core.audio
Class ByteArrayAudioStream
java.lang.Object
java.io.InputStream
org.openhab.core.audio.AudioStream
org.openhab.core.audio.FixedLengthAudioStream
org.openhab.core.audio.ByteArrayAudioStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- ClonableAudioStream,- SizeableAudioStream
This is an implementation of an 
AudioStream with known length and a clone method, which is based on a simple
 byte array.- Author:
- Kai Kreuzer - Initial contribution
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Returns a new, fully independent stream instance, which can be read and closed without impacting the original instance.Gets the supported audio formatlonglength()Provides the length of the stream in bytes.voidmark(int readlimit) booleanintread()voidreset()Methods inherited from class org.openhab.core.audio.AudioStreamgetIdMethods inherited from class java.io.InputStreamavailable, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
- 
Constructor Details- 
ByteArrayAudioStream
 
- 
- 
Method Details- 
getFormatDescription copied from class:AudioStreamGets the supported audio format- Specified by:
- getFormatin class- AudioStream
- Returns:
- The supported audio format
 
- 
read- Specified by:
- readin class- InputStream
- Throws:
- IOException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
- Throws:
- IOException
 
- 
lengthpublic long length()Description copied from interface:SizeableAudioStreamProvides the length of the stream in bytes.- Returns:
- absolute length in bytes
 
- 
getClonedStreamDescription copied from interface:ClonableAudioStreamReturns a new, fully independent stream instance, which can be read and closed without impacting the original instance.- Returns:
- a new input stream that can be consumed by the caller
 
- 
markpublic void mark(int readlimit) - Overrides:
- markin class- InputStream
 
- 
reset- Overrides:
- resetin class- InputStream
- Throws:
- IOException
 
- 
markSupportedpublic boolean markSupported()- Overrides:
- markSupportedin class- InputStream
 
 
-