T
- the type of objects accessedpublic interface DataAccess<T> extends StatefulCopyable<DataAccess<T>>, Marshallable
Data
object, cached
inside the DataAccess
instance. This strategy interface is suitable for types of objects,
that are already in fact sequences of bytes (byte[]
, ByteBuffer
, etc.) and
shouldn't be serialized, and allows to avoid extra data copying. Accessed bytes should be later
readable by some BytesReader
.
Read DataAccess
and SizedReader
and
custom
serialization checklist sections in the Chronicle Map tutorial for more information on this
interface, how to implement and use it properly.
EMPTY
DISCARD
Modifier and Type | Method and Description |
---|---|
Data<T> |
getData(T instance)
Obtain
Data accessor to the bytes of the given object. |
void |
uninit()
Clear references to the accessed object (provided in
getData(Object) method) in
caching fields of this DataAccess or the cached Data object, returned from
getData(Object) . |
copy, copyIfNeeded
$equals, $fieldInfos, $hashCode, $toString, copyFrom, copyTo, deepCopy, fromFile, fromFile, fromFileAsMap, fromFileAsMap, fromHexString, fromString, fromString, getClassName, getField, mergeToMap, readMarshallable, reset, setField, streamFromFile, streamFromFile, writeMarshallable
writeValue
unexpectedField
Data<T> getData(@NotNull T instance)
Data
accessor to the bytes of the given object. Typically a Data
instance should be cached in a field of this DataAccess
, so always the same object
is returned.instance
- the object to access bytes (serialized form) ofvoid uninit()
getData(Object)
method) in
caching fields of this DataAccess
or the cached Data
object, returned from
getData(Object)
.
DataAccess
is cached itself in thread-local variables for ChronicleHash
instances, this method prevents leaking of accessed objects (they are not eligible for
garbage collection while there are some references).
Copyright © 2018. All rights reserved.