public static enum MappedByteBufferInputStream.CacheMode extends Enum<MappedByteBufferInputStream.CacheMode>
Enum Constant and Description |
---|
FLUSH_NONE
Keep all previous lazily cached buffer slices alive, useful for hopping readers,
i.e.
|
FLUSH_PRE_HARD
Hard flush the previous lazily cached buffer slice when caching the next buffer slice,
useful for sequential forward readers.
|
FLUSH_PRE_SOFT
Soft flush the previous lazily cached buffer slice when caching the next buffer slice,
useful for sequential forward readers, as well as for hopping readers like
FLUSH_NONE
in case of relatively short periods between hopping across slices. |
Modifier and Type | Method and Description |
---|---|
static MappedByteBufferInputStream.CacheMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MappedByteBufferInputStream.CacheMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MappedByteBufferInputStream.CacheMode FLUSH_NONE
position(p)
or reset()
.
Note that without flushing, the platform may fail memory mapping
due to virtual address space exhaustion.
In such case an OutOfMemoryError
may be thrown directly,
or encapsulated as the the cause
of a thrown IOException
.
public static final MappedByteBufferInputStream.CacheMode FLUSH_PRE_SOFT
FLUSH_NONE
in case of relatively short periods between hopping across slices.
Implementation clears the buffer slice reference
while preserving a WeakReference
to allow its resurrection if not yet
garbage collected
.
public static final MappedByteBufferInputStream.CacheMode FLUSH_PRE_HARD
Besides clearing the buffer slice reference,
implementation attempts to hard flush the mapped buffer
using a sun.misc.Cleaner
by reflection.
In case such method does not exist nor works, implementation falls back to FLUSH_PRE_SOFT
.
This is the default.
public static MappedByteBufferInputStream.CacheMode[] values()
for (MappedByteBufferInputStream.CacheMode c : MappedByteBufferInputStream.CacheMode.values()) System.out.println(c);
public static MappedByteBufferInputStream.CacheMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is null