Search in sources :

Example 1 with ByteIterableBase

use of jetbrains.exodus.ByteIterableBase in project xodus by JetBrains.

the class PropertyTypes method entryToPropertyValue.

public PropertyValue entryToPropertyValue(@NotNull final ByteIterable entry) {
    final ByteIterableBase it = (ByteIterableBase) entry;
    final byte[] bytes = it.getBytesUnsafe();
    final ComparableValueType type = getPropertyType((byte) (bytes[0] ^ 0x80));
    final Comparable data = type.getBinding().readObject(new ByteArrayInputStream(bytes, 1, it.getLength() - 1));
    return new PropertyValue(type, data);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteIterableBase(jetbrains.exodus.ByteIterableBase) ComparableValueType(jetbrains.exodus.bindings.ComparableValueType)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteIterableBase (jetbrains.exodus.ByteIterableBase)1 ComparableValueType (jetbrains.exodus.bindings.ComparableValueType)1