public class SharedFileBackedOutputStream extends FileBackedOutputStream
incrementUsageCount(). The cleanup() method decrements the usage count and,
when it reaches 0, the FileBackedOutputStream.cleanup() is called to delete the backing file.| Constructor and Description |
|---|
SharedFileBackedOutputStream(int fileThreshold,
String fileDirectory) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Overridden to decrement the usage count.
|
int |
getUsageCount()
Returns the current usage count.
|
void |
incrementUsageCount()
Increments the usage count.
|
<T> void |
setOnCleanupCallback(Consumer<T> callback,
T context)
Sets the callback to be notified when
FileBackedOutputStream.cleanup() is called to delete the backing
file. |
asByteSource, close, flush, getCount, write, write, writepublic SharedFileBackedOutputStream(int fileThreshold,
String fileDirectory)
public void incrementUsageCount()
cleanup() when this
instance is no longer needed.public int getUsageCount()
public <T> void setOnCleanupCallback(Consumer<T> callback, T context)
FileBackedOutputStream.cleanup() is called to delete the backing
file.public void cleanup()
cleanup in class FileBackedOutputStreamCopyright © 2019 OpenDaylight. All rights reserved.