java.io.Closeable, java.lang.AutoCloseable@Private
public class BestEffortLongFile
extends java.lang.Object
implements java.io.Closeable
long
value, but does not make any effort to make it truly durable. This is in
contrast to PersistentLongFile which fsync()s the value on every
change.
This should be used for values which are updated frequently (such that
performance is important) and not required to be up-to-date for correctness.
This class also differs in that it stores the value as binary data instead
of a textual string.| Constructor | Description |
|---|---|
BestEffortLongFile(java.io.File file,
long defaultVal) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
long |
get() |
|
void |
set(long newVal) |
public BestEffortLongFile(java.io.File file,
long defaultVal)
public long get()
throws java.io.IOException
java.io.IOExceptionpublic void set(long newVal)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.