Class ByteArrayAsset
java.lang.Object
org.jboss.shrinkwrap.api.asset.ByteArrayAsset
- All Implemented Interfaces:
Asset
-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayAsset(byte[] content) Creates a newAssetinstance backed by the specified byte arrayByteArrayAsset(InputStream stream) Creates a newAssetinstance backed by the bytes contained in the specifiedInputStream -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the underlying content.Get an input stream for the resource content.toString()
-
Constructor Details
-
ByteArrayAsset
Creates a newAssetinstance backed by the specified byte array- Parameters:
content- The byte array that will be used as the data source for the newByteArrayAsset- Throws:
IllegalArgumentException- If the contents were not specified
-
ByteArrayAsset
Creates a newAssetinstance backed by the bytes contained in the specifiedInputStream- Parameters:
stream- TheInputStreamto read bytes from- Throws:
IllegalArgumentException- If the stream is not specified
-
-
Method Details
-
openStream
Description copied from interface:AssetGet an input stream for the resource content. The caller is responsible for closing the stream.- Specified by:
openStreamin interfaceAsset- Returns:
- A new open
InputStreamfor each call - See Also:
-
getSource
public byte[] getSource()Returns the underlying content. -
toString
-