java.lang.Object
cloud.piranha.resource.ByteArrayResource
- All Implemented Interfaces:
Resource
- Direct Known Subclasses:
StringResource
The byte-array resource.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet all locations.byte[]
getBytes()
Returns the byte-array.getResource(String url)
Get the resource.getResourceAsStream(String url)
Get the resource as a stream.getResourceAsStreamByLocation(String location)
Get the resource as stream by location.
-
Constructor Details
-
ByteArrayResource
Constructor.- Parameters:
location
- the location.bytes
- the byte-array.
-
-
Method Details
-
getAllLocations
Get all locations.- Specified by:
getAllLocations
in interfaceResource
- Returns:
- the locations.
-
getBytes
public byte[] getBytes()Returns the byte-array.- Returns:
- the byte-array
-
getResource
Get the resource.- Specified by:
getResource
in interfaceResource
- Parameters:
url
- the url in string form.- Returns:
- the URL, or null if not found.
-
getResourceAsStream
Get the resource as a stream.- Specified by:
getResourceAsStream
in interfaceResource
- Parameters:
url
- the location in URL form- Returns:
- the input stream.
-
getResourceAsStreamByLocation
Get the resource as stream by location.- Parameters:
location
- the location.- Returns:
- the input stream
-