public interface MCvalueStorageEx extends MCvalueStorage
By default the toolkit stores large attribute values in memory or temporary files, depending on configuration and value size. This interface can be used for application defined value storage locations and strategies.
Value storage instances are obtained by the toolkit from registered value storage providers. A separate
instance is used for each attribute. See MCvalueStorageProvider
and
MCapplication.registerValueStorageProvider(MCvalueStorageProvider, int)
for more details.
The methods of this interface may be called in arbitrary threads but the toolkit ensures that calls are synchronized and no two calls will occur simultaneously.
If a method throws an exception the toolkit will report the exception to the operation that triggered the call (e.g. message read/write) and the operation will be aborted.
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
provideData(boolean first,
long offset)
This method is called by the toolkit to obtain data for the attribute's value with given offset.
|
provideData, provideDataLength, receiveData, receiveDataLength, receiveMediaDataLength, receiveOffsetTable, reset
java.nio.ByteBuffer provideData(boolean first, long offset)
The toolkit calls this method when it needs the attribute's value for encoding. If the first call
does not return the whole value, the toolkit will make subsequent calls until the return value is
null
.
An implementation is expected to set the position and limit on the returned byte buffer so that its
remaining()
method returns the number of bytes provided by the current call.
If the returned buffer is a direct buffer (backed by native memory) the toolkit will try to avoid marshaling the data into the managed memory passing the native buffer directly to the native code.
first
- true
if the toolkit is requesting data from the beginning of the value,
false
if the toolkit is requesting data that follows the data returned by a previous
call.offset
- the offset of the attribute valuenull
.