public class SerializerByteArrayDelta2 extends java.lang.Object implements GroupSerializer<byte[]>
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 |
---|
SerializerByteArrayDelta2() |
Modifier and Type | Method and Description |
---|---|
int |
compare(byte[] o1,
byte[] o2) |
byte[] |
deserialize(DataInput2 input,
int available)
Deserializes and returns the content of the given
DataInput2 . |
boolean |
equals(byte[] a1,
byte[] a2)
Returns if the first and second arguments are equal to each other.
|
int |
hashCode(byte[] bytes,
int seed)
Returns a hash code of a given non-null argument.
|
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.
|
void |
serialize(DataOutput2 out,
byte[] value)
Serializes the content of the given value into the given
DataOutput2 . |
SerializerStringDelta2.ByteArrayKeys |
valueArrayCopyOfRange(java.lang.Object keys,
int from,
int to) |
SerializerStringDelta2.ByteArrayKeys |
valueArrayDeleteValue(java.lang.Object keys,
int pos) |
SerializerStringDelta2.ByteArrayKeys |
valueArrayDeserialize(DataInput2 in,
int size) |
SerializerStringDelta2.ByteArrayKeys |
valueArrayEmpty() |
SerializerStringDelta2.ByteArrayKeys |
valueArrayFromArray(java.lang.Object[] keys) |
byte[] |
valueArrayGet(java.lang.Object keys,
int pos) |
SerializerStringDelta2.ByteArrayKeys |
valueArrayPut(java.lang.Object keys,
int pos,
byte[] newValue) |
int |
valueArraySearch(java.lang.Object keys,
byte[] key) |
int |
valueArraySearch(java.lang.Object keys,
byte[] key,
java.util.Comparator comparator) |
void |
valueArraySerialize(DataOutput2 out,
java.lang.Object keys2) |
int |
valueArraySize(java.lang.Object keys) |
SerializerStringDelta2.ByteArrayKeys |
valueArrayUpdateVal(java.lang.Object vals,
int pos,
byte[] newValue) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
nextValue, valueArrayBinaryGet, valueArrayBinarySearch, valueArrayToArray
clone, deserializeFromLong, fixedSize, needsAvailableSizeHint
public int valueArraySearch(java.lang.Object keys, byte[] key)
valueArraySearch
in interface GroupSerializer<byte[]>
public int valueArraySearch(java.lang.Object keys, byte[] key, java.util.Comparator comparator)
valueArraySearch
in interface GroupSerializer<byte[]>
public void valueArraySerialize(DataOutput2 out, java.lang.Object keys2) throws java.io.IOException
valueArraySerialize
in interface GroupSerializer<byte[]>
java.io.IOException
public SerializerStringDelta2.ByteArrayKeys valueArrayDeserialize(DataInput2 in, int size) throws java.io.IOException
valueArrayDeserialize
in interface GroupSerializer<byte[]>
java.io.IOException
public byte[] valueArrayGet(java.lang.Object keys, int pos)
valueArrayGet
in interface GroupSerializer<byte[]>
public int valueArraySize(java.lang.Object keys)
valueArraySize
in interface GroupSerializer<byte[]>
public SerializerStringDelta2.ByteArrayKeys valueArrayEmpty()
valueArrayEmpty
in interface GroupSerializer<byte[]>
public SerializerStringDelta2.ByteArrayKeys valueArrayPut(java.lang.Object keys, int pos, byte[] newValue)
valueArrayPut
in interface GroupSerializer<byte[]>
public SerializerStringDelta2.ByteArrayKeys valueArrayUpdateVal(java.lang.Object vals, int pos, byte[] newValue)
valueArrayUpdateVal
in interface GroupSerializer<byte[]>
public SerializerStringDelta2.ByteArrayKeys valueArrayFromArray(java.lang.Object[] keys)
valueArrayFromArray
in interface GroupSerializer<byte[]>
public SerializerStringDelta2.ByteArrayKeys valueArrayCopyOfRange(java.lang.Object keys, int from, int to)
valueArrayCopyOfRange
in interface GroupSerializer<byte[]>
public SerializerStringDelta2.ByteArrayKeys valueArrayDeleteValue(java.lang.Object keys, int pos)
valueArrayDeleteValue
in interface GroupSerializer<byte[]>
public void serialize(@NotNull DataOutput2 out, @NotNull byte[] value) throws java.io.IOException
Serializer
DataOutput2
.serialize
in interface Serializer<byte[]>
out
- DataOutput2 to save object intovalue
- Object to serializejava.io.IOException
- in case of an I/O errorpublic byte[] deserialize(@NotNull DataInput2 input, int available) throws java.io.IOException
Serializer
DataInput2
.deserialize
in interface Serializer<byte[]>
input
- 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).DataInput2
java.io.IOException
- in case of an I/O errorpublic int compare(byte[] o1, byte[] o2)
compare
in interface java.util.Comparator<byte[]>
compare
in interface Serializer<byte[]>
public boolean equals(byte[] a1, byte[] a2)
Serializer
null
, true
is
returned and if exactly one argument is null
, false
is
returned.equals
in interface Serializer<byte[]>
a1
- an objecta2
- another object to be compared with the first object for
equalityObject.equals(Object)
public int hashCode(@NotNull byte[] bytes, int seed)
Serializer
hashCode
in interface Serializer<byte[]>
bytes
- an objectseed
- used to "scramble" theObject.hashCode()
public boolean isTrusted()
Serializer
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.
isTrusted
in interface Serializer<byte[]>
Copyright © 2018. All Rights Reserved.