use of jetbrains.exodus.util.ByteArraySizedInputStream in project xodus by JetBrains.
the class PersistentEntityStoreImpl method setBlob.
public void setBlob(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity, @NotNull final String blobName, @NotNull final InputStream stream) throws IOException {
final ByteArraySizedInputStream copy = stream instanceof ByteArraySizedInputStream ? (ByteArraySizedInputStream) stream : blobVault.cloneStream(stream, true);
final long blobHandle = createBlobHandle(txn, entity, blobName, copy, copy.size());
if (!isEmptyOrInPlaceBlobHandle(blobHandle)) {
setBlobFileLength(txn, blobHandle, copy.size());
txn.addBlob(blobHandle, copy);
}
}
use of jetbrains.exodus.util.ByteArraySizedInputStream in project xodus by JetBrains.
the class PropertyTypes method entryToPropertyValue.
public PropertyValue entryToPropertyValue(@NotNull final ByteIterable entry, @Nullable ComparableBinding binding) {
final byte[] bytes = entry.getBytesUnsafe();
final ComparableValueType type = getPropertyType((byte) (bytes[0] ^ 0x80));
if (binding == null) {
binding = type.getBinding();
}
final Comparable data = binding.readObject(new ByteArraySizedInputStream(bytes, 1, entry.getLength() - 1));
return new PropertyValue(type, data);
}
Aggregations