Package cloud.piranha.resource
Class ByteArrayResource
- java.lang.Object
-
- cloud.piranha.resource.ByteArrayResource
-
- All Implemented Interfaces:
Resource
public class ByteArrayResource extends Object implements Resource
The byte-array resource.- Author:
- Manfred Riem ([email protected])
-
-
Constructor Summary
Constructors Constructor Description ByteArrayResource(String location, byte[] bytes)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<String>
getAllLocations()
Get all locations.byte[]
getBytes()
Get the byte-array.URL
getResource(String location)
Get the resource.InputStream
getResourceAsStream(String location)
Get the resource as a stream.
-
-
-
Constructor Detail
-
ByteArrayResource
public ByteArrayResource(String location, byte[] bytes)
Constructor.- Parameters:
location
- the location.bytes
- the byte-array.
-
-
Method Detail
-
getAllLocations
public Stream<String> getAllLocations()
Get all locations.- Specified by:
getAllLocations
in interfaceResource
- Returns:
- the locations.
-
getBytes
public byte[] getBytes()
Get the byte-array.- Returns:
- the byte-array.
-
getResource
public URL getResource(String location)
Get the resource.- Specified by:
getResource
in interfaceResource
- Parameters:
location
- the location.- Returns:
- the URL, or null if not found.
-
getResourceAsStream
public InputStream getResourceAsStream(String location)
Get the resource as a stream.- Specified by:
getResourceAsStream
in interfaceResource
- Parameters:
location
- the location.- Returns:
- the input stream.
-
-