Class CachingResourceBundleData
java.lang.Object
org.pentaho.reporting.libraries.resourceloader.cache.CachingResourceBundleData
- All Implemented Interfaces:
Serializable,ResourceBundleData,ResourceData
A very simple implementation which is suitable for smaller objects. The complete data is read into memory.
- Author:
- Thomas Morgner
- See Also:
-
Field Summary
Fields inherited from interface org.pentaho.reporting.libraries.resourceloader.ResourceData
CONTENT_LENGTH, CONTENT_TYPE, FILENAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceBundleDataderiveData(ResourceKey key) deriveManager(ResourceManager parent) getAttribute(String key) getKey()longbyte[]getResource(ResourceManager caller) This is dangerous, especially if the resource is large.intgetResource(ResourceManager caller, byte[] target, long offset, int length) Tries to read data into the given byte-array.getResourceAsStream(ResourceManager caller) longgetVersion(ResourceManager caller)
-
Constructor Details
-
CachingResourceBundleData
-
-
Method Details
-
getResourceAsStream
- Specified by:
getResourceAsStreamin interfaceResourceData- Throws:
ResourceLoadingException
-
getLength
public long getLength()- Specified by:
getLengthin interfaceResourceData
-
getResource
Description copied from interface:ResourceDataThis is dangerous, especially if the resource is large.- Specified by:
getResourcein interfaceResourceData- Returns:
- Throws:
ResourceLoadingException
-
getResource
public int getResource(ResourceManager caller, byte[] target, long offset, int length) throws ResourceLoadingException Description copied from interface:ResourceDataTries to read data into the given byte-array.- Specified by:
getResourcein interfaceResourceData- Returns:
- the number of bytes read or -1 if no more data can be read.
- Throws:
ResourceLoadingException
-
getAttribute
- Specified by:
getAttributein interfaceResourceData
-
getKey
- Specified by:
getKeyin interfaceResourceData
-
getVersion
- Specified by:
getVersionin interfaceResourceData- Throws:
ResourceLoadingException
-
getBundleKey
- Specified by:
getBundleKeyin interfaceResourceBundleData
-
deriveData
- Specified by:
deriveDatain interfaceResourceBundleData- Throws:
ResourceLoadingException
-
deriveManager
- Specified by:
deriveManagerin interfaceResourceBundleData- Throws:
ResourceLoadingException
-
getBackend
-
createCached
-