util-ref/src/main/java/com/hpe/caf/util/ref/ReferencedData.java
public synchronized InputStream acquire(final DataSource source)
        throws DataSourceException
    {
        InputStream ret;
        if (data == null) {
            if (getReference() == null) {
                throw new IllegalStateException("No data or reference present");
            } else {
                ret = source.getStream(getReference());
            }
        } else {
            ret = new ByteArrayInputStream(data);
        }
        return ret;
    }
public synchronized InputStream acquire(final DataSource source)
        throws DataSourceException
    {
        InputStream ret;
        if (data == null) {
            if (getReference() == null) {
                throw new IllegalStateException("No data or reference present");
            } else {
                ret = source.getStream(getReference());
            }
        } else {
            ret = new ByteArrayInputStream(data);
        }
        return ret;
    }
Return the referenced data as a stream, potentially performing a remote lookup.

@param source the implementation that provides object instances given the provided references
@return a stream of the data that this container is wrapping
@throws DataSourceException if the data cannot be acquired
@throws IllegalStateException if there is no object or reference present