Package com.jogamp.common.nio
Enum MappedByteBufferInputStream.CacheMode
java.lang.Object
java.lang.Enum<MappedByteBufferInputStream.CacheMode>
com.jogamp.common.nio.MappedByteBufferInputStream.CacheMode
- All Implemented Interfaces:
Serializable,Comparable<MappedByteBufferInputStream.CacheMode>,java.lang.constant.Constable
- Enclosing class:
- MappedByteBufferInputStream
public static enum MappedByteBufferInputStream.CacheMode
extends Enum<MappedByteBufferInputStream.CacheMode>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionKeep all previous lazily cached buffer slices alive, useful for hopping readers, i.e.Hard flush the previous lazily cached buffer slice when caching the next buffer slice, useful for sequential forward readers.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 likeFLUSH_NONEin case of relatively short periods between hopping across slices. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this type with the specified name.values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
FLUSH_NONE
Keep all previous lazily cached buffer slices alive, useful for hopping readers, i.e. random access viaposition(p)orreset().Note that without flushing, the platform may fail memory mapping due to virtual address space exhaustion.
In such case anOutOfMemoryErrormay be thrown directly, or encapsulated as thethe causeof a thrownIOException. -
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 likeFLUSH_NONEin case of relatively short periods between hopping across slices.Implementation clears the buffer slice reference while preserving a
WeakReferenceto allow its resurrection if not yetgarbage collected. -
FLUSH_PRE_HARD
Hard flush the previous lazily cached buffer slice when caching the next buffer slice, useful for sequential forward readers.Besides clearing the buffer slice reference, implementation attempts to hard flush the mapped buffer using a
sun.misc.Cleanerby reflection. In case such method does not exist nor works, implementation falls back toFLUSH_PRE_SOFT.This is the default.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-