Package org.openhab.core.cache.lru
Class InputStreamCacheWrapper
java.lang.Object
java.io.InputStream
org.openhab.core.cache.lru.InputStreamCacheWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
Each cache result instance can handle several
InputStreams.
This class is a wrapper for such functionality and can
ask the cached entry for data, allowing concurrent access to
the source even if it is currently actively read from the supplier service.
This class implements the two main read methods (byte by byte, and with an array)- Author:
- Gwendal Roulleau - Initial contribution
-
Constructor Summary
ConstructorsConstructorDescriptionInputStreamCacheWrapper(LRUMediaCacheEntry<?> cacheEntry) Construct a transparent InputStream wrapper around data from the cache. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
InputStreamCacheWrapper
Construct a transparent InputStream wrapper around data from the cache.- Parameters:
cacheEntry- The parent cachedLRUMediaCacheEntry
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
length
public long length() -
getClonedStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-