List of usage examples for org.hibernate.engine.jdbc SerializableBlobProxy getWrappedBlob
public Blob getWrappedBlob()
From source file:cognition.pipeline.data.helper.BlobHelper.java
License:Apache License
private byte[] getBytesFromSerializableBlob(Object serializableBlobProxy) { SerializableBlobProxy blobProxy = (SerializableBlobProxy) Proxy.getInvocationHandler(serializableBlobProxy); Blob wrappedBlob = blobProxy.getWrappedBlob(); try {//from w w w . j a v a2 s . c o m byte[] bytes = wrappedBlob.getBytes(1, (int) wrappedBlob.length()); if (bytes != null) { if (bytes.length == 0) { return null; } } return bytes; } catch (SQLException e) { e.printStackTrace(); } return null; }