public class SerializerRecid extends SerializerEightByte<java.lang.Long>
BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BYTE, BYTE_ARRAY, BYTE_ARRAY_DELTA, BYTE_ARRAY_DELTA2, BYTE_ARRAY_NOSIZE, CHAR, CHAR_ARRAY, CLASS, DATE, DOUBLE, DOUBLE_ARRAY, ELSA, FLOAT, FLOAT_ARRAY, ILLEGAL_ACCESS, INT_ARRAY, INTEGER, INTEGER_DELTA, INTEGER_PACKED, JAVA, LONG, LONG_ARRAY, LONG_DELTA, LONG_PACKED, RECID, RECID_ARRAY, SHORT, SHORT_ARRAY, STRING, STRING_ASCII, STRING_DELTA, STRING_DELTA2, STRING_INTERN, STRING_NOSIZE, STRING_ORIGHASH, UUID| Constructor and Description |
|---|
SerializerRecid() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Long |
deserialize(DataInput2 in,
int available)
Deserializes and returns the content of the given
DataInput2. |
int |
fixedSize()
Returns the fixed size of the serialized form in bytes or -1 if the size
is not fixed (e.g.
|
boolean |
isTrusted()
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.
|
protected long |
pack(java.lang.Long l) |
void |
serialize(DataOutput2 out,
java.lang.Long value)
Serializes the content of the given value into the given
DataOutput2. |
protected java.lang.Long |
unpack(long l) |
java.lang.Long |
valueArrayBinaryGet(DataInput2 input,
int keysLen,
int pos) |
long[] |
valueArrayDeserialize(DataInput2 in,
int size) |
int |
valueArraySearch(java.lang.Object keys,
java.lang.Long key) |
void |
valueArraySerialize(DataOutput2 out,
java.lang.Object vals) |
valueArrayCopyOfRange, valueArrayDeleteValue, valueArrayEmpty, valueArrayFromArray, valueArrayGet, valueArrayPut, valueArraySearch, valueArraySize, valueArrayUpdateValclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnextValue, valueArrayBinarySearch, valueArrayToArrayclone, compare, deserializeFromLong, equals, hashCode, needsAvailableSizeHintpublic void serialize(DataOutput2 out, java.lang.Long value) throws java.io.IOException
SerializerDataOutput2.out - DataOutput2 to save object intovalue - Object to serializejava.io.IOException - in case of an I/O errorpublic java.lang.Long deserialize(DataInput2 in, int available) throws java.io.IOException
SerializerDataInput2.in - DataInput2 to de-serialize data fromavailable - how many bytes that are available in the DataInput2 for
reading, may be -1 (in streams) or 0 (null).DataInput2java.io.IOException - in case of an I/O errorpublic int fixedSize()
SerializerSome optimizations can be applied to serializers with a fixed size.
fixedSize in interface Serializer<java.lang.Long>fixedSize in class SerializerEightByte<java.lang.Long>protected java.lang.Long unpack(long l)
unpack in class SerializerEightByte<java.lang.Long>protected long pack(java.lang.Long l)
pack in class SerializerEightByte<java.lang.Long>public boolean isTrusted()
SerializerMapDB 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.
isTrusted in interface Serializer<java.lang.Long>isTrusted in class SerializerEightByte<java.lang.Long>public int valueArraySearch(java.lang.Object keys,
java.lang.Long key)
public void valueArraySerialize(DataOutput2 out, java.lang.Object vals) throws java.io.IOException
valueArraySerialize in interface GroupSerializer<java.lang.Long>valueArraySerialize in class SerializerEightByte<java.lang.Long>java.io.IOExceptionpublic long[] valueArrayDeserialize(DataInput2 in, int size) throws java.io.IOException
valueArrayDeserialize in interface GroupSerializer<java.lang.Long>valueArrayDeserialize in class SerializerEightByte<java.lang.Long>java.io.IOExceptionpublic java.lang.Long valueArrayBinaryGet(DataInput2 input, int keysLen, int pos) throws java.io.IOException
valueArrayBinaryGet in interface GroupSerializer<java.lang.Long>valueArrayBinaryGet in class SerializerEightByte<java.lang.Long>java.io.IOExceptionCopyright © 2018. All Rights Reserved.