int[] lengthRead = new int[] {length};
ByteBuffer buffer = ByteBuffer.allocateDirect(array.length);
int returnCode = ndbBlob.readData(buffer, lengthRead);
handleError(returnCode, ndbBlob);
if (lengthRead[0] != length) {
throw new ClusterJFatalInternalException(
local.message("ERR_Blob_Read_Data", length, lengthRead[0]));
}
// now copy into user space
buffer.get(array);
}