@ThreadSafe public final class StreamCache extends Object
Constructor and Description |
---|
StreamCache(long timeoutMs)
Creates a new instance of
StreamCache . |
Modifier and Type | Method and Description |
---|---|
FileInStream |
getInStream(Integer key) |
FileOutStream |
getOutStream(Integer key) |
Closeable |
invalidate(Integer key) |
Integer |
put(FileInStream is) |
Integer |
put(FileOutStream os) |
long |
size() |
public StreamCache(long timeoutMs)
StreamCache
.timeoutMs
- the timeout (in milliseconds) for the stream cache evictionpublic FileInStream getInStream(Integer key)
key
- the key to get the stream forpublic FileOutStream getOutStream(Integer key)
key
- the key to get the stream forpublic Integer put(FileInStream is)
is
- the stream to cachepublic Integer put(FileOutStream os)
os
- the stream to cache@Nullable public Closeable invalidate(Integer key)
key
- the key for the stream to invalidatepublic long size()
Copyright © 2023. All Rights Reserved.