org.spicefactory.cinnamon.config.resource
Class ByteArrayResource
java.lang.Object
org.spicefactory.cinnamon.config.resource.AbstractResource
org.spicefactory.cinnamon.config.resource.ByteArrayResource
- All Implemented Interfaces:
- Resource
public class ByteArrayResource
- extends AbstractResource
Resource implementation that wraps a byte array.
- Author:
- Jens Halm
|
Constructor Summary |
ByteArrayResource(byte[] buffer)
Creates a new resource instance wrapping the specified byte array. |
ByteArrayResource(byte[] buffer,
String path)
Creates a new resource instance wrapping the specified byte array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayResource
public ByteArrayResource(byte[] buffer)
- Creates a new resource instance wrapping the specified byte array.
- Parameters:
buffer - the bytes to wrap
ByteArrayResource
public ByteArrayResource(byte[] buffer,
String path)
- Creates a new resource instance wrapping the specified byte array.
- Parameters:
buffer - the bytes to wrappath - the path of the resource (in the context of this class only a description)
getInputStream
public InputStream getInputStream()
throws ResourceException
- Description copied from interface:
Resource
- Creates an InputStream for this Resource.
- Returns:
- an InputStream for this Resource
- Throws:
ResourceException - if the InputStream cannot be created