util-ref/src/main/java/com/hpe/caf/util/ref/ReferencedData.java
public synchronized long size(final DataSource source)
        throws DataSourceException
    {
        if (data == null) {
            if (getReference() == null) {
                throw new IllegalStateException("No data or reference present");
            } else {
                return source.getDataSize(getReference());
            }
        } else {
            return data.length;
        }
    }
public synchronized long size(final DataSource source)
        throws DataSourceException
    {
        if (data == null) {
            if (getReference() == null) {
                throw new IllegalStateException("No data or reference present");
            } else {
                return source.getDataSize(getReference());
            }
        } else {
            return data.length;
        }
    }
public synchronized long size ( final DataSource source ) throws DataSourceException { if ( data == null ) { if ( getReference ( ) == null ) { throw new IllegalStateException ( "No data or reference present" ) ; } else { return source . getDataSize ( getReference ( ) ) ; } } else { return data . length ; } }
Determine the size of the data.

@param source the implementation that provides object instances given the provided references
@return the size of the abstracted data, in bytes
@throws DataSourceException if the size information cannot be acquired
Determine the size of the data .