public static enum DataBuffer.AccessMode extends java.lang.Enum<DataBuffer.AccessMode>
data buffers. There are 3 possible modes:
PRIVATE. See comments to these constants.
|Enum Constant and Description|
This mode works almost alike
This access mode should be used if you need read-only access to the data.
This access mode should be used if you need write access to data.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final DataBuffer.AccessMode READ
UpdatableArrayinterface (so, it is probably
Please note: there are no guarantees that the data buffer, created
with this access mode, will not allow to change the data in the underlying storage.
For example, in direct data buffer
all changes in the
reflect in the original storage immediately even in this access mode.
public static final DataBuffer.AccessMode READ_WRITE
public static final DataBuffer.AccessMode PRIVATE
READ_WRITE, but any changes in the data array are lost. More precisely, there are two differences from
data arraynever reflect in the original storage (so, the data buffers, created with this mode, are never direct);
DataBuffer.force(long, long)methods do nothing.
In other words, this mode (unlike
READ) guarantees that the data in
the underlying storage will not be changed, and any changes in the
data array will be lost.
This mode can be convenient if you do not really need writing access to the data,
but want to have a right to safely change the content of the returned data array
(for example, to use it as a work memory).
public static DataBuffer.AccessMode values()
for (DataBuffer.AccessMode c : DataBuffer.AccessMode.values()) System.out.println(c);
public static DataBuffer.AccessMode valueOf(java.lang.String name)
name- the name of the enum constant to be returned.
java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
java.lang.NullPointerException- if the argument is null