org.mapdb / QueueLong / Node / SERIALIZER

SERIALIZER

object SERIALIZER : Serializer<Node>


Functions

deserialize fun deserialize(input: DataInput2, available: Int): Node?
serialize fun serialize(out: DataOutput2, value: Node): Unit

Inherited Functions

deserializeFromLong open fun deserializeFromLong(input: Long, available: Int): A

Deserializes and returns the content of the given long.

fixedSize open fun fixedSize(): Int

Returns the fixed size of the serialized form in bytes or -1 if the size is not fixed (e.g. for Strings).

Some optimizations can be applied to serializers with a fixed size.

isTrusted open fun isTrusted(): Boolean

Returns if this Serializer is trusted to always read the same number of bytes as it writes for any given object being serialized/de-serialized.

MapDB has a relaxed record size boundary checking. It expects deserializers to read exactly as many bytes as were written during serialization. If a deserializer reads more bytes than it wrote, it might start reading others record data in store.

Some serializers (Kryo) have problems with this. To prevent this, we can not read data directly from a store, but we must copy them into separate byte[] buffers. Thus, zero-copy optimizations are disabled by default, but can be explicitly enabled here by letting this method return true.

This flag indicates if this serializer was 'verified' to read as many bytes as it writes. It should also be much better tested etc.

needsAvailableSizeHint open fun needsAvailableSizeHint(): Boolean

TODO: Document this method